RelationshipManager.GetRelatedReference(String, String) RelationshipManager.GetRelatedReference(String, String) RelationshipManager.GetRelatedReference(String, String) RelationshipManager.GetRelatedReference(String, String) Method

Definition

Gets the EntityReference<TEntity> for a related object by using the specified combination of relationship name and target role name.

public:
generic <typename TTargetEntity>
 where TTargetEntity : class System::Data::Objects::DataClasses::EntityReference<TTargetEntity> ^ GetRelatedReference(System::String ^ relationshipName, System::String ^ targetRoleName);
public System.Data.Objects.DataClasses.EntityReference<TTargetEntity> GetRelatedReference<TTargetEntity> (string relationshipName, string targetRoleName) where TTargetEntity : class;
member this.GetRelatedReference : string * string -> System.Data.Objects.DataClasses.EntityReference<'argetEntity (requires 'argetEntity : null)> (requires 'argetEntity : null)
Public Function GetRelatedReference(Of TTargetEntity As Class) (relationshipName As String, targetRoleName As String) As EntityReference(Of TTargetEntity)

Type Parameters

TTargetEntity

The type of the returned EntityReference<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

EntityReference<TTargetEntity>

The EntityReference<TEntity> of a related object.

Exceptions

Remarks

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

Applies to