Kuroro
Kuroro

Reputation: 1931

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

I am configuring 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 have read the MSDN page for the EntitySetRights Enumeration but I can't identify the difference between EntitySetRights.WriteMerge and EntitySetRights.WriteReplace

I found the below explanation at Using Microsoft ADO.NET Data Services

Upvotes: 3

Views: 587

Answers (2)

Phani Raj
Phani Raj

Reputation: 514

In the ADO.NET Data Services server, we define WriteMerge as changing individual properties of an entity. (An example is Changing the FirstName of an Employee Instance.) And WriteReplace as replacing an entity with another entity . ( An example is Changing an Employee by resetting all of the Entity's properties to defaults and then set the properties explicitly .)

With WriteMerge , you can send a request with the MERGE verb to an Entity's endpoint , with WriteReplace , you can send a request with the PUT verb to an Entity's endpoint .

Hope this helps.

Upvotes: 1

daxsorbito
daxsorbito

Reputation: 1810

WriteMerge-Merge-based updates are permitted. WriteReplace-Replacing is permitted

Please take a look at this link. http://msdn.microsoft.com/en-us/magazine/dd569758.aspxlink text

Upvotes: 1

Related Questions