For conditional merges, you don't have to do anything. Your code will throw an error (PreCondition
failed - Http Status Code 412
) if during the merge operation ETag
doesn't match. So your code above will work perfectly fine.
For unconditional merges, you would need to manually set the ETag
property of the entity to *
.