다음을 통해 공유


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

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

특성

예외

경우 entitySetName 또는 빈 문자열입니다 null .

-또는-

시기 changed 입니다.null

from entitySetNameEntitySetEntitySet 개체EntityKey의 .

-또는-

엔터티가 또는 ModifiedUnchanged. 이외의 상태에 있는 경우

-또는-

원래 개체가 컨텍스트에 연결되지 않았습니다.

개체의 형식이 changed 원래 개체와 같은 형식이 아닌 경우

설명

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

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

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

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

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

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

적용 대상