RelationshipManager.InitializeRelatedCollection<TTargetEntity> 메서드

정의

매개 변수가 없는 생성자를 사용하여 만들어진 기존 EntityCollection<TEntity>를 초기화합니다.

public:
generic <typename TTargetEntity>
 where TTargetEntity : class, System::Data::Objects::DataClasses::IEntityWithRelationships void InitializeRelatedCollection(System::String ^ relationshipName, System::String ^ targetRoleName, System::Data::Objects::DataClasses::EntityCollection<TTargetEntity> ^ entityCollection);
public:
generic <typename TTargetEntity>
 where TTargetEntity : class void InitializeRelatedCollection(System::String ^ relationshipName, System::String ^ targetRoleName, System::Data::Objects::DataClasses::EntityCollection<TTargetEntity> ^ entityCollection);
[System.ComponentModel.Browsable(false)]
public void InitializeRelatedCollection<TTargetEntity> (string relationshipName, string targetRoleName, System.Data.Objects.DataClasses.EntityCollection<TTargetEntity> entityCollection) where TTargetEntity : class, System.Data.Objects.DataClasses.IEntityWithRelationships;
[System.ComponentModel.Browsable(false)]
public void InitializeRelatedCollection<TTargetEntity> (string relationshipName, string targetRoleName, System.Data.Objects.DataClasses.EntityCollection<TTargetEntity> entityCollection) where TTargetEntity : class;
[<System.ComponentModel.Browsable(false)>]
member this.InitializeRelatedCollection : string * string * System.Data.Objects.DataClasses.EntityCollection<'argetEntity (requires 'argetEntity : null and 'argetEntity :> System.Data.Objects.DataClasses.IEntityWithRelationships)> -> unit (requires 'argetEntity : null and 'argetEntity :> System.Data.Objects.DataClasses.IEntityWithRelationships)
[<System.ComponentModel.Browsable(false)>]
member this.InitializeRelatedCollection : string * string * System.Data.Objects.DataClasses.EntityCollection<'argetEntity (requires 'argetEntity : null)> -> unit (requires 'argetEntity : null)
Public Sub InitializeRelatedCollection(Of TTargetEntity As {Class, IEntityWithRelationships}) (relationshipName As String, targetRoleName As String, entityCollection As EntityCollection(Of TTargetEntity))
Public Sub InitializeRelatedCollection(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String, entityCollection As EntityCollection(Of TTargetEntity))

형식 매개 변수

TTargetEntity

초기화 중인 EntityCollection<TEntity>의 형식입니다.

매개 변수

relationshipName
String

관계 이름입니다.

targetRoleName
String

관련 End의 역할 이름입니다.

entityCollection
EntityCollection<TTargetEntity>

초기화할 EntityCollection<TEntity>입니다.

특성

예외

제공된 EntityCollection<TEntity>가 이미 초기화된 경우

또는

관계 관리자가 ObjectContext에 이미 연결된 경우

또는

관계 관리자에 이 이름 및 대상 역할의 관계가 이미 포함되어 있는 경우

설명

메서드는 InitializeRelatedCollection 매개 변수가 없는 생성자를 사용하여 만든 기존 EntityCollection<TEntity> 를 초기화합니다. 는 EntityCollection<TEntity> 제공된 관계 및 대상 역할 이름을 사용하여 초기화됩니다.

메서드는 InitializeRelatedCollection 역직렬화 중에만 사용됩니다.

적용 대상