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>

例外狀況

備註

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

此關聯性名稱不應該符合命名空間。 當您在關聯性名稱前面加上命名空間時,就會發生錯誤。

適用於