Language

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> 。

例外

指定されたロールは、EntityReference<TEntity>ではなくEntityCollection<TEntity>を返しました。

適用対象