Issue with resolving OData Delete calls with ETags on property type of byte array #491
I am unable to successfully delete an entity using If-Match header with the ETag provided. I always retrieve an 412 no matter the format I try. I am preforming a spike and the only developer hitting the end point, thus no concurrency issues. This may not be an Actual Bug, but I can not seem to find documentation to help in my use case.
On a simple EF model done from "Code First from existing database" Create an Object of
Retrieve a 204 No Data, and the entity is removed from the target database.
Must provide If-Match Header or a 412.
Here is an example of the get request to a specific entity, and then the attempted delete call with the appropriate etag.
I HAVE MASKED THE URL ENDPOINTS due the public view, willing to work one on one to help resolve by unmasking
The text was updated successfully, but these errors were encountered:
Can you post the defination of entity UserPreferences? @mbryantII I'd like to know where you use ConcurrencyCheck.
I am currently not using that attribute on any items.
For your scenario, you put a TimeStamp attribute on
If you really want to use
Thanks for your reply, in reality that is a database generated column that the user does not place in a post call.
here is what that call looks like.
and the response
i just don't want to interfere from a model perspective by removing that attribute, and placing concurrency check on it if its going to cause issues on the back end with EF. Some general advice here would be great!
@mbryantII If etag support is not needed for UserPreferences entity set in your case, then there is one workaround to remove the concurrency properties now, it is a little ugly as it need reflection call.
Let me know if this does not work for you.
As to where to put these code, you will need to define your own APi class, and create a model builder, you can refer to class https://github.com/OData/RESTier/blob/master/test/ODataEndToEnd/Microsoft.OData.Service.Sample.Trippin/Api/TrippinApi.cs, create a class like TrippinModelCustomizer , and then register in ConfigureApi method.