共用方式為


RelationshipManager.GetRelatedCollection<TTargetEntity> 方法

定義

取得具有指定之關聯性名稱和目標角色名稱的相關物件的 EntityCollection<TEntity>

public System.Data.Entity.Core.Objects.DataClasses.EntityCollection<TTargetEntity> GetRelatedCollection<TTargetEntity>(string relationshipName, string targetRoleName) where TTargetEntity : class;
member this.GetRelatedCollection : string * string -> System.Data.Entity.Core.Objects.DataClasses.EntityCollection<'argetEntity (requires 'argetEntity : null)> (requires 'argetEntity : null)
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>

例外狀況

適用於