ObjectContext.ApplyPropertyChanges(String, Object) 메서드

정의

주의

Use ApplyCurrentValues instead

분리된 개체의 속성 변경을 개체 컨텍스트에 이미 연결된 개체에 적용합니다.

public:
 void ApplyPropertyChanges(System::String ^ entitySetName, System::Object ^ changed);
public void ApplyPropertyChanges (string entitySetName, object changed);
[System.ComponentModel.Browsable(false)]
[System.Obsolete("Use ApplyCurrentValues instead")]
public void ApplyPropertyChanges (string entitySetName, object changed);
member this.ApplyPropertyChanges : string * obj -> unit
[<System.ComponentModel.Browsable(false)>]
[<System.Obsolete("Use ApplyCurrentValues instead")>]
member this.ApplyPropertyChanges : string * obj -> unit
Public Sub ApplyPropertyChanges (entitySetName As String, changed As Object)

매개 변수

entitySetName
String

개체가 속한 엔터티 집합의 이름입니다.

changed
Object

원래 개체에 적용할 속성 업데이트가 있는 분리된 개체입니다.

특성

예외

entitySetNamenull이거나 빈 문자열인 경우

또는

changednull일 경우

entitySetNameEntitySet가 개체 EntityKeyEntitySet과 일치하지 않는 경우

또는

엔터티의 상태가 Modified 또는 Unchanged가 아닌 경우

또는

원래 개체가 컨텍스트에 연결되지 않은 경우

changed 개체의 형식이 원래 개체의 형식과 다른 경우

설명

메서드는 ApplyCurrentValues 개체의 수정된 분리된 버전에서 에 연결된 원래 버전으로 속성 변경 내용을 적용하는 ObjectContext데 사용됩니다. 이 메서드는 엔터티 개체를 분리하여 속성이 업데이트된 원격 애플리케이션에 전송하는 웹 서비스 같은 시나리오를 지원합니다. 이 메서드를 사용하면 이러한 변경 내용을 원래 개체에 더 쉽게 다시 적용할 수 있습니다.

이후에 ApplyCurrentValues는 개체가 상태에 있습니다 Modified . 메서드를 SaveChanges 호출하여 데이터 원본을 업데이트해야 합니다.

원래 개체는 에 ObjectStateManager 있어야 하며 또는 Unchanged 상태여야 Modified 합니다. 원래 개체는 개체에 수정된 속성이 있는 changed 경우에만 수정됩니다.

EntityKey 제공된 개체의 속성을 유효한 EntityKey로 설정해야 합니다.

ApplyCurrentValues 탐색 속성 또는 관련 개체에는 영향을 주지 않습니다.

ApplyCurrentValues 형식에 대한 엔터티 메타데이터에 있는 속성만 설정합니다. 예를 들어 partial 클래스에 추가된 속성은 작업에 포함되지 ApplyCurrentValues 않습니다.

적용 대상