RelationshipManager.GetRelatedCollection(String, String) RelationshipManager.GetRelatedCollection(String, String) RelationshipManager.GetRelatedCollection(String, String) RelationshipManager.GetRelatedCollection(String, String) Method

Definition

Gets an EntityCollection<TEntity> of related objects with the specified relationship name and target role name.

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;
member this.GetRelatedCollection : string * string -> System.Data.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)

Type Parameters

TTargetEntity

The type of the returned EntityCollection<TEntity>.

Parameters

relationshipName
String String String String

Name of the relationship to navigate. The relationship name is not namespace qualified.

targetRoleName
String String String String

Name of the target role for the navigation. Indicates the direction of navigation across the relationship.

Returns

EntityCollection<TTargetEntity>

The EntityCollection<TEntity> of related objects.

Exceptions

Remarks

Gets an EntityCollection<TEntity> of related objects that have the specified relationship name and target role name.

The relationship name should not be namespace qualified. An error occurs when you prepend the namespace to the relationship name.

Applies to