DataServiceContext에서 추적 중인 엔터티 목록에서 엔터티를 제거합니다.
네임스페이스: System.Data.Services.Client
어셈블리: Microsoft.Data.Services.Client(Microsoft.Data.Services.Client.dll)
구문
‘선언
Public Function Detach ( _
entity As Object _
) As Boolean
‘사용 방법
Dim instance As DataServiceContext
Dim entity As Object
Dim returnValue As Boolean
returnValue = instance.Detach(entity)
public bool Detach(
Object entity
)
public:
bool Detach(
Object^ entity
)
member Detach :
entity:Object -> bool
public function Detach(
entity : Object
) : boolean
매개 변수
- entity
유형: System.Object
DataServiceContext 에서 분리할 추적된 엔터티입니다.
반환 값
유형: System.Boolean
지정된 엔터티가 분리된 경우 true를 반환하고, 그렇지 않으면 false를 반환합니다.
예외
| 예외 | 조건 |
|---|---|
| ArgumentNullException | entity가 nullnull 참조(Visual Basic에서는 Nothing)인 경우 |
주의
개체가 분리되면 더 이상 DataServiceContext에서 추적되지 않습니다.
Detach 메서드를 호출하여 EntityStates에 관계없이 모든 개체를 분리할 수 있습니다.
지정된 엔터티를 분리한 후 이 메서드는 해당 엔터티와 관련된 모든 링크도 분리합니다.