Does Simple.OData.Client support open properties?

自闭症网瘾萝莉.ら 提交于 2019-12-11 20:35:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!