Export (0) Print
Expand All

DataServiceContext.ChangeState Method

Changes the state of the given entity. Note that the 'Added' state is not supported by this method, and that AddObject or AddRelatedObject should be used instead. If the state 'Modified' is given, calling this method is exactly equivalent to calling UpdateObject. If the state 'Deleted' is given, calling this method is exactly equivalent to calling DeleteObject. If the state 'Detached' is given, calling this method is exactly equivalent to calling Detach. If the state 'Unchanged' is given, the state will be changed, but no other modifications will be made to the entity or entity descriptor associated with it.

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

public void ChangeState(
	Object entity,
	EntityStates state
)

Parameters

entity
Type: System.Object
The entity whose state to change.
state
Type: System.Data.Services.Client.EntityStates
The new state of the entity.
Show:
© 2014 Microsoft