RelationshipManager.GetRelatedCollection<TTargetEntity> 메서드

정의

지정된 관계 이름 및 대상 역할 이름을 사용하여 관련 개체의 EntityCollection<TEntity>을 가져옵니다.

public:
generic <typename TTargetEntity>
 where TTargetEntity : class, System::Data::Objects::DataClasses::IEntityWithRelationships System::Data::Objects::DataClasses::EntityCollection<TTargetEntity> ^ GetRelatedCollection(System::String ^ relationshipName, System::String ^ targetRoleName);
public:
generic <typename TTargetEntity>
 where TTargetEntity : class System::Data::Objects::DataClasses::EntityCollection<TTargetEntity> ^ GetRelatedCollection(System::String ^ relationshipName, System::String ^ targetRoleName);
public System.Data.Objects.DataClasses.EntityCollection<TTargetEntity> GetRelatedCollection<TTargetEntity> (string relationshipName, string targetRoleName) where TTargetEntity : class, System.Data.Objects.DataClasses.IEntityWithRelationships;
public System.Data.Objects.DataClasses.EntityCollection<TTargetEntity> GetRelatedCollection<TTargetEntity> (string relationshipName, string targetRoleName) where TTargetEntity : class;
member this.GetRelatedCollection : string * string -> System.Data.Objects.DataClasses.EntityCollection<'argetEntity (requires 'argetEntity : null and 'argetEntity :> System.Data.Objects.DataClasses.IEntityWithRelationships)> (requires 'argetEntity : null and 'argetEntity :> System.Data.Objects.DataClasses.IEntityWithRelationships)
member this.GetRelatedCollection : string * string -> System.Data.Objects.DataClasses.EntityCollection<'argetEntity (requires 'argetEntity : null)> (requires 'argetEntity : null)
Public Function GetRelatedCollection(Of TTargetEntity As {Class, IEntityWithRelationships}) (relationshipName As String, targetRoleName As String) As EntityCollection(Of TTargetEntity)
Public Function GetRelatedCollection(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String) As EntityCollection(Of TTargetEntity)

형식 매개 변수

TTargetEntity

반환된 EntityCollection<TEntity>의 형식입니다.

매개 변수

relationshipName
String

탐색할 관계의 이름입니다. 관계 이름은 네임스페이스로 정규화되지 않습니다.

targetRoleName
String

탐색에 사용할 대상 역할의 이름입니다. 관계를 탐색할 방향을 나타냅니다.

반환

EntityCollection<TTargetEntity>

관련 개체의 EntityCollection<TEntity>입니다.

예외

지정된 역할에서 EntityReference<TEntity> 대신 EntityCollection<TEntity>를 반환한 경우

설명

지정한 EntityCollection<TEntity> 관계 이름과 대상 역할 이름을 가진 관련 개체의 을 가져옵니다.

관계 이름은 네임스페이스로 한정되어서는 안 됩니다. 네임스페이스를 관계 이름 앞에 추가하면 오류가 발생합니다.

적용 대상