Udostępnij za pośrednictwem


DataServiceContext.DeleteObject Method

Changes the state of the specified object to be deleted in the DataServiceContext.

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

Syntax

'Declaration
Public Sub DeleteObject ( _
    entity As Object _
)
'Usage
Dim instance As DataServiceContext 
Dim entity As Object

instance.DeleteObject(entity)
public void DeleteObject(
    Object entity
)
public:
void DeleteObject(
    Object^ entity
)
member DeleteObject : 
        entity:Object -> unit
public function DeleteObject(
    entity : Object
)

Parameters

  • entity
    Type: System.Object
    The tracked entity to be changed to the deleted state.

Exceptions

Exception Condition
ArgumentNullException

When entity is nulla null reference (Nothing in Visual Basic).

InvalidOperationException

When the object is not being tracked by the DataServiceContext.

Remarks

All links to the specified entity are also marked deleted.

See Also

Reference

DataServiceContext Class

System.Data.Services.Client Namespace