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>

例外

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

注釈

指定されたリレーションシップ名とターゲット ロール名を持つ、関連オブジェクトの EntityCollection<TEntity> を取得します。

リレーションシップ名を名前空間で修飾しないでください。 リレーションシップ名の前に名前空間を付けると、エラーが発生します。

適用対象