RelationshipManager.GetRelatedCollection<TTargetEntity> Metoda

Definice

Získá související EntityCollection<TEntity> objekty se zadaným názvem relace a názvem cílové role.

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)

Parametry typu

TTargetEntity

Typ vráceného EntityCollection<TEntity>souboru .

Parametry

relationshipName
String

Název relace, na které chcete přejít. Název relace není kvalifikovaný.

targetRoleName
String

Název cílové role pro navigaci Určuje směr navigace v rámci relace.

Návraty

EntityCollection<TTargetEntity>

Související EntityCollection<TEntity> objekty.

Výjimky

Poznámky

EntityCollection<TEntity> Získá související objekty, které mají zadaný název relace a název cílové role.

Název relace by neměl být kvalifikovaným oborem názvů. Při předpřipravení oboru názvů k názvu relace dojde k chybě.

Platí pro