DataServiceContext.UpdateObject Method (Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Changes the state of the specified object in the DataServiceContext to Modified.

Namespace:   System.Data.Services.Client
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)

member UpdateObject : 
        entity:Object -> unit

Parameters

entity
Type: System.Object

The tracked entity to be assigned to the Modified state.

Exception Condition
ArgumentNullException

When entity is null.

ArgumentException

When entity is in the Detached state.

The following example retrieves and modifies an existing object and then calls the UpdateObject method on the DataServiceContext to mark the item in the context as updated. An HTTP MERGE message is sent to the data service when SaveChanges is called. This example uses the DataServiceContext generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the WCF Data Services .

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Silverlight
Available since 2.0
Return to top
Show: