다음을 통해 공유


DataServiceContext.AttachTo 메서드 (String, Object)

지정된 리소스의 추적을 시작하도록 DataServiceContext에 알리고 지정된 리소스 집합 내의 리소스 위치를 제공합니다.

네임스페이스:  System.Data.Services.Client
어셈블리:  Microsoft.Data.Services.Client(Microsoft.Data.Services.Client.dll)

구문

‘선언
Public Sub AttachTo ( _
    entitySetName As String, _
    entity As Object _
)
‘사용 방법
Dim instance As DataServiceContext
Dim entitySetName As String
Dim entity As Object

instance.AttachTo(entitySetName, entity)
public void AttachTo(
    string entitySetName,
    Object entity
)
public:
void AttachTo(
    String^ entitySetName, 
    Object^ entity
)
member AttachTo : 
        entitySetName:string * 
        entity:Object -> unit 
public function AttachTo(
    entitySetName : String, 
    entity : Object
)

매개 변수

  • entitySetName
    유형: System.String
    리소스를 포함하는 집합의 이름입니다.

예외

예외 조건
ArgumentNullException

entity 또는 entitySetName이 nullnull 참조(Visual Basic에서는 Nothing)인 경우

ArgumentException

entitySetName이 빈 문자열인 경우

또는

entity에 키 속성이 정의되어 있지 않은 경우

InvalidOperationException

컨텍스트에서 entity를 이미 추적 중인 경우

주의

엔터티가 개체 그래프의 일부인 경우 이 작업은 그래프를 트래버스하여 관련 개체를 추가하지 못합니다. 이 작업은 부분 작업입니다.

이 메서드는 지정된 엔터티 집합이 DataServiceContext와 연관된 데이터 서비스에서 발생하는지 여부를 확인하지 않습니다.

참고 항목

참조

DataServiceContext 클래스

AttachTo 오버로드

System.Data.Services.Client 네임스페이스