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)

Syntax

'Declaration
Public Sub ChangeState ( _
    entity As Object, _
    state As EntityStates _
)
'Usage
Dim instance As DataServiceContext 
Dim entity As Object 
Dim state As EntityStates

instance.ChangeState(entity, state)
public void ChangeState(
    Object entity,
    EntityStates state
)
public:
void ChangeState(
    Object^ entity, 
    EntityStates state
)
member ChangeState : 
        entity:Object * 
        state:EntityStates -> unit
public function ChangeState(
    entity : Object, 
    state : EntityStates
)

Parameters

See Also

Reference

DataServiceContext Class

System.Data.Services.Client Namespace