다음을 통해 공유


RelationshipManager.GetRelatedReference<TTargetEntity> 메서드

정의

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

public System.Data.Entity.Core.Objects.DataClasses.EntityReference<TTargetEntity> GetRelatedReference<TTargetEntity> (string relationshipName, string targetRoleName) where TTargetEntity : class;
member this.GetRelatedReference : string * string -> System.Data.Entity.Core.Objects.DataClasses.EntityReference<'argetEntity (requires 'argetEntity : null)> (requires 'argetEntity : null)
Public Function GetRelatedReference(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String) As EntityReference(Of TTargetEntity)

형식 매개 변수

TTargetEntity

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

매개 변수

relationshipName
String

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

targetRoleName
String

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

반환

EntityReference<TTargetEntity>

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

예외

지정된 역할은 대신 를 EntityCollection<TEntity> 반환했습니다 EntityReference<TEntity> .

적용 대상