Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replate ODataEntry with ODataResource #300

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Odata-docs/client/using-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ Then, developers can replace the default client message with `CustomizedClientRe

`public DataServiceClientRequestPipelineConfiguration OnEntryStarting(Action<WritingEntryArgs> action)`

Developers can use this function to control the information of an `ODataEntry` to be serialized.
Developers can use this function to control the information of an `ODataResource` to be serialized.

#### Modify ODataEntry properties
#### Modify ODataResource properties

The following code provides a sample to add properties to an `ODataEntry`.
The following code provides a sample to add properties to an `ODataResource`.

```c#

public static void AddProperties(this ODataEntry entry, params ODataProperty[] newProperties)
public static void AddProperties(this ODataResource entry, params ODataProperty[] newProperties)
{
var odataProps = entry.Properties as List<ODataProperty>;
if (odataProps == null)
Expand All @@ -232,7 +232,7 @@ The following code provides a sample to add properties to an `ODataEntry`.

### Set `OnEntryStarting`

Then, to add new properties in the `ODataEntry`, developers can call `AddProperties` in `OnEntryStarting`.
Then, to add new properties in the `ODataResource`, developers can call `AddProperties` in `OnEntryStarting`.

```c#
DefaultContainer dataServiceContext = new DefaultContainer(new Uri("https://services.odata.org/v4/(S(ghojd5jj5d33cwotkyfwn431))/TripPinServiceRW/"));
Expand Down