user2824991
user2824991

Reputation: 41

Does Simple.OData.Client support open properties?

I am working with Simple Odata Library

https://github.com/object/Simple.OData.Client/wiki

I need to define open parameters, but i dont seam to see any definition or documentation for this.

Example for clarification:

Along with my oData call, i send a parameter called "mode", which i can set to any number between 0-10. My server will know what to do with it. This parameter however is not pre-defined.

Upvotes: 0

Views: 1372

Answers (2)

Vagif Abilov
Vagif Abilov

Reputation: 9991

Recent releases of Simple.OData.Client support OData open types, look at examples here:

https://github.com/object/Simple.OData.Client/blob/master/Simple.OData.Client.IntegrationTests/TripPinTests.cs

Search for tests containing "OpenProperty".

Upvotes: 1

Sam Xu
Sam Xu

Reputation: 3380

user2824991:

I think so. I have tested the untyped and typed scenario for both query and update.

For example:

var order = await client.For("Orders")
   .Set(new {OrderId = 9, OrderName = "New Order", MyProperty = "Dynamic Property", GuidProperty = Guid.NewGuid()})
.InsertEntryAsync();

Where, "OrderId" and "OrderName" are both declared properties, while "MyProperty" and "GuidProperty" are both dynamic properties.

Here's my test codes update. it belongs to my sample project.

Upvotes: 0

Related Questions