unchase / Unchase.Odata.Connectedservice

:scroll: A Visual Studio extension for connecting to OData services with generating client-side C# proxy-classes
Apache License 2.0
44 stars 13 forks source link

Question: DataServiceQuery vs DataServiceCollection #53

Closed TripleNico closed 3 years ago

TripleNico commented 3 years ago

Quick question: I use the autogenerate Client code for VB.net i noticed that in v4 i have difficulties updating a object. i get the exception No routing convention was found to select an action for the OData path with template '~/entityset/key'. I back traced this due to the fact that on SaveChanges the method PUT is passed while the backend expects PATCH instead. In OData v3 you had this option SaveChangesOptions.PatchOnUpdate but that's gone in v4. So i dived in deeper and noticed then when i change it to DataServiceCollection instead of DataServiceQuery the PUT/PATCH method seems to be correct.

So i was wondering why it is a DataServiceQuery instead of DataServiceCollection generated?

My knowledge about OData isn't expert so hopefully you could explain it in simple words :-)

In the meantime i'm using this dirty workarround to get it working: If request.Method = Method.PUT.ToString Then request.Method = Method.PATCH.ToString

unchase commented 3 years ago

Hi, @TripleNico Can you open the same issue in OdataConnectedService repository?

TripleNico commented 3 years ago

Sure, see #210