語言

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>

例外狀況

適用於