DataServiceContext.DeleteLink 方法

更改要在链接列表中删除的链接的状态,该链接列表由 DataServiceContext 进行跟踪。

命名空间:  System.Data.Services.Client
程序集:  Microsoft.Data.Services.Client(在 Microsoft.Data.Services.Client.dll 中)

语法

声明
Public Sub DeleteLink ( _
    source As Object, _
    sourceProperty As String, _
    target As Object _
)
用法
Dim instance As DataServiceContext
Dim source As Object
Dim sourceProperty As String
Dim target As Object

instance.DeleteLink(source, sourceProperty, _
    target)
public void DeleteLink(
    Object source,
    string sourceProperty,
    Object target
)
public:
void DeleteLink(
    Object^ source, 
    String^ sourceProperty, 
    Object^ target
)
member DeleteLink : 
        source:Object * 
        sourceProperty:string * 
        target:Object -> unit 
public function DeleteLink(
    source : Object, 
    sourceProperty : String, 
    target : Object
)

参数

  • source
    类型:System.Object
    标记为要删除的链接中的源对象。
  • sourceProperty
    类型:System.String
    源对象上用于访问目标对象的导航属性的名称。
  • target
    类型:System.Object
    链接中涉及的已绑定到源对象的目标对象。目标对象类型必须是源属性所标识的类型或子类型。

异常

异常 条件
ArgumentNullException

当 source、sourceProperty 或 target 为 null 时。

InvalidOperationException

当 source 或 target 处于 DetachedAdded 状态时。

- 或 -

当 sourceProperty 不是一个集合时。

注释

DataServiceContext 跟踪的任何链接(不管其当前状态如何)均可分离。

请参阅

参考

DataServiceContext 类

System.Data.Services.Client 命名空间