MappedEntityDomainManager(Of TData, TModel).SetOriginalVersion Method (TModel, Byte())
Override this method to support optimistic concurrent updates and replace operations. In order to evaluate whether an object has been updated concurrently, Entity Framework needs to know the original version of the object being edited and compare that to the current version maintained in the database. This requires that the original value is known by Entity Framework so that it can ask the database to do the check.
Assembly: Microsoft.WindowsAzure.Mobile.Service.Entity (in Microsoft.WindowsAzure.Mobile.Service.Entity.dll)
Parameters
- model
-
Type:
TModel
The current entity model object.
- version
-
Type:
System.Byte()
The original version provided by the request as being the version that is being updated; or null if no version was indicated.
In case the column used to manage versioning is called "Version", the code to set the original value looks like this: this.context.Entry(model).OriginalValues["Version"] = version;