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 處於 Detached 或 Added 狀態時。 -或- 當 sourceProperty 不是集合時。 |
備註
不論連結的目前狀態為何,DataServiceContext 正在追蹤的任何連結都可以被中斷連結。