RelatedEnd.Attach<TEntity>(IEnumerable<TEntity>, Boolean) 메서드

정의

연결된 두 개체 간의 관계를 정의합니다.

protected public:
generic <typename TEntity>
 void Attach(System::Collections::Generic::IEnumerable<TEntity> ^ entities, bool allowCollection);
protected internal void Attach<TEntity> (System.Collections.Generic.IEnumerable<TEntity> entities, bool allowCollection);
member this.Attach : seq<'Entity> * bool -> unit
Protected Friend Sub Attach(Of TEntity) (entities As IEnumerable(Of TEntity), allowCollection As Boolean)

형식 매개 변수

TEntity

연결할 엔터티 개체 컬렉션의 형식 IEnumerable<T> 입니다.

매개 변수

entities
IEnumerable<TEntity>

엔터티 개체의 IEnumerable<T> 컬렉션입니다.

allowCollection
Boolean

연결되는 개체가 컬렉션의 멤버인지 여부를 지정합니다.

설명

메서드는 Attach<TEntity>(IEnumerable<TEntity>, Boolean) 두 개체가 이미 개체 컨텍스트에 연결되어 있는 경우 개체와 관련 개체 간의 관계를 정의하는 데 사용됩니다. 관련 개체를 의 EntityReference<TEntity> 속성으로 Value 설정하거나 관련 개체가 개체 컨텍스트에 아직 연결되지 않은 경우 에서 EntityCollection<TEntity> 메서드를 호출 Add 합니다. 두 개체가 분리되면 관련 개체 Value 를 의 EntityReference<TEntity> 속성으로 설정하거나 의 메서드 EntityCollection<TEntity> 를 호출 Add 한 다음 개체 그래프에서 루트 개체를 연결하여 관계를 정의할 수도 있습니다. 자세한 내용은 개체 연결 및 분리를 참조하세요.

메서드는 Attach<TEntity>(IEnumerable<TEntity>, Boolean) 관련 끝에 대 한 연결 작업 하는 동안 Object Services에 의해 호출 됩니다.

적용 대상