Does Simple.OData.Client support open properties?

1.3k Views Asked by At

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.

2

There are 2 best solutions below

0
On

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".

0
On

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.