After quite some googling, you guys have to help now.
Im consuming an Odata Service with the OData v4 Client Code Generator
Everything worked nice and (almost) as it should. Now i need to update an Entity which i have queried and modified before.
The struggle im facing is, i must do a partial update since there are some Properties in this Entity that must not be changed. If the Endpoint detects changes on these props, it throws an exception.
Some time ago i learned, i should be able to do such partial updates and the internet is full of good advices on how to do so. Unfortunately, all of this suggetions refer to EF-6-DataContext and not Odata-DataContext.
Also i do not have much code to show but this
_container.UserSystem.Context.ChangeState(e,EntityStates.Modified);
var resp = _container.SaveChanges(SaveChangesOptions.PostOnlySetProperties);
As you might notice, im setting the SaveChangesOptions.PostOnlySetProperties
which im not allowed to (Not working on DataServiceQueries). I already tried this without the SaveChangesOptions.PostOnlySetProperties
facing the mentioned Exceptions.
Question
How can i tell that bloody Microsoft.OData.Client.DataServiceContext
to perform partial updates and not to update the the whole Entity?