DataServiceContext.DetachLink 方法

DataServiceContext 所跟踪的链接列表中移除指定链接。

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

语法

声明
Public Function DetachLink ( _
    source As Object, _
    sourceProperty As String, _
    target As Object _
) As Boolean
用法
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

参数

  • source
    类型:System.Object
    参与了标记为要删除的链接的源对象。
  • sourceProperty
    类型:System.String
    源对象上的属性名称,表示源和目标之间的链接中的源。
  • target
    类型:System.Object
    链接中涉及的已绑定到源对象的目标对象。目标对象类型必须是源属性所标识的类型或子类型。

返回值

类型:System.Boolean
如果指定的实体已分离,则返回 true;否则返回 false。

异常

异常 条件
ArgumentNullException

当 source 或 sourceProperty 为 nullnull 引用(在 Visual Basic 中为 Nothing) 时。

ArgumentException

当 sourceProperty 为空字符串时。

注释

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

请参阅

参考

DataServiceContext 类

System.Data.Services.Client 命名空间