DataServiceContext.AttachLink メソッド

エンティティ オブジェクト間のリレーションシップを定義する指定されたリンクの追跡を開始するように DataServiceContext に通知します。

名前空間:  System.Data.Services.Client
アセンブリ:  Microsoft.Data.Services.Client (Microsoft.Data.Services.Client.dll)

構文

'宣言
Public Sub AttachLink ( _
    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.AttachLink(source, sourceProperty, _
    target)
public void AttachLink(
    Object source,
    string sourceProperty,
    Object target
)
public:
void AttachLink(
    Object^ source, 
    String^ sourceProperty, 
    Object^ target
)
member AttachLink : 
        source:Object * 
        sourceProperty:string * 
        target:Object -> unit 
public function AttachLink(
    source : Object, 
    sourceProperty : String, 
    target : Object
)

パラメーター

  • source
    型: System.Object
    新しいリンクのソース オブジェクト。
  • sourceProperty
    型: System.String
    ソース オブジェクトとターゲット オブジェクト間のリンクを表す、ソース オブジェクトのプロパティの名前。
  • target
    型: System.Object
    この呼び出しで指定されたソース オブジェクトにバインドされるリンク内のターゲット オブジェクト。ターゲット オブジェクトは、ソース プロパティで識別される型かサブタイプである必要があります。

例外

例外 条件
ArgumentNullException

source、sourceProperty、または target が null の場合。

InvalidOperationException

2 つのエンティティ間のリンクが既に存在する場合。

または

source または target の状態が Added または Deleted の場合。

関連項目

参照

DataServiceContext クラス

System.Data.Services.Client 名前空間