问题
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.
回答1:
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".
回答2:
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.
来源:https://stackoverflow.com/questions/31816887/does-simple-odata-client-support-open-properties