RelatedEnd.Attach<TEntity>(IEnumerable<TEntity>, Boolean) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
연결된 두 개체 간의 관계를 정의합니다.
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) 메서드는 두 개체가 이미 개체 컨텍스트에 연결된 경우 개체와 관련 개체 간의 관계를 정의하는 데 사용됩니다. 관련 개체가 개체 컨텍스트에 EntityCollection<TEntity> 아직 연결되지 않은 경우 관련 개체 Value 를 해당 속성 EntityReference<TEntity> 으로 설정하거나 메서드를 호출 Add 합니다. 두 개체가 모두 분리된 경우 관련 개체 Value 를 해당 속성 EntityReference<TEntity> 으로 설정하거나 메서드를 호출 AddEntityCollection<TEntity> 한 다음 개체 그래프에서 루트 개체를 연결하여 관계를 정의할 수도 있습니다. 자세한 내용은 개체 연결 및 분리를 참조하세요.
이 Attach<TEntity>(IEnumerable<TEntity>, Boolean) 메서드는 관련 끝에 대한 연결 작업 중에 Object Services에서 호출됩니다.