What is the difference between WriteReplace & WriteMerge in ADO.NET DataService?

I am setting up an ADO.NET DataService.

public static void InitializeService(IDataServiceConfiguration config)
{
    // config.UseVerboseErrors = true;
    // TODO: set rules to indicate which entity sets and service operations are
    //       visible, updatable, etc.
    // Examples:
    config.SetEntitySetAccessRule("User", EntitySetRights.WriteMerge);
    config.SetEntitySetAccessRule("User", EntitySetRights.WriteReplace);
}

I read the MSDN page for EntitySetRights Enumeration , but I can not tell the difference between EntitySetRights.WriteMerge and EntitySetRights.WriteReplace

I found the following explanation in Using Microsoft ADO.NET Data Services

  • WriteMerge: In the case of merge-based updates, the payload should be an entity and should only contain properties that change. If the property is not enabled, the value that is currently present on the server will be saved . Example 14 shows the payload used to update the category that was inserted in the previous example.

  • WriteReplace: , , ( ). , reset . PUT , AtomPub RFC 5023. 13 , , ​​ . , , , reset .

+3
2

ADO.NET WriteMerge . (, FirstName Employee.)   WriteReplace . ( " ", Entity , .)

WriteMerge MERGE Entity, WriteReplace PUT Entity.

, .

+1

WriteMerge-Merge. WriteReplace-

, . http://msdn.microsoft.com/en-us/magazine/dd569758.aspx

+1

Source: https://habr.com/ru/post/1719780/


All Articles