Udostępnij za pośrednictwem


DataServiceContext.DetachLink Method

Removes the specified link from the list of links being tracked by the DataServiceContext.

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

Syntax

'Declaration
Public Function DetachLink ( _
    source As Object, _
    sourceProperty As String, _
    target As Object _
) As Boolean
'Usage
Dim instance As DataServiceContext 
Dim source As Object 
Dim sourceProperty As String 
Dim target As Object 
Dim returnValue As Boolean 

returnValue = instance.DetachLink(source, _
    sourceProperty, target)
public bool DetachLink(
    Object source,
    string sourceProperty,
    Object target
)
public:
bool DetachLink(
    Object^ source, 
    String^ sourceProperty, 
    Object^ target
)
member DetachLink : 
        source:Object * 
        sourceProperty:string * 
        target:Object -> bool
public function DetachLink(
    source : Object, 
    sourceProperty : String, 
    target : Object
) : boolean

Parameters

  • source
    Type: System.Object
    The source object participating in the link to be marked for deletion.
  • sourceProperty
    Type: System.String
    The name of the property on the source object that represents the source in the link between the source and the target.
  • target
    Type: System.Object
    The target object involved in the link that is bound to the source object. The target object must be of the type identified by the source property or a subtype.

Return Value

Type: System.Boolean
Returns true if the specified entity was detached; otherwise false.

Exceptions

Exception Condition
ArgumentNullException

When source or sourceProperty are nulla null reference (Nothing in Visual Basic).

ArgumentException

When sourceProperty is an empty string.

Remarks

Any link being tracked by the DataServiceContext, regardless of its current state, can be detached.

See Also

Reference

DataServiceContext Class

System.Data.Services.Client Namespace