davidyack / Xrm.Tools.CRMWebAPI

This is an API helper for working with the Common Data Service (CDS) Web API
MIT License
143 stars 73 forks source link

Please I need to know a sample how optimistic concurrency #98

Closed JORGEGO closed 4 years ago

JORGEGO commented 4 years ago

Befor to move to WebAPI I has used RowVersion to check if my record has changed or not, what it is now the alternative... I Know WebApi is using 'If-Match Header'. Etag: , but really I don't know how to do it using your excellent library. Could you share us a simple sample Thanks

JORGEGO commented 4 years ago

I believe you should allow to send the ETAG

if (!Upsert)

            request.Headers.Add("If-Match", "*");   
JORGEGO commented 4 years ago

I fixed it request.Headers.Add("If-Match", "W/\""+pVersionNumber+"\""); Thanks