Compartilhar via


EntityExtensions.GetRelatedEntity<TEntity> Method (Entity, Relationship)

 

Applies To: Dynamics CRM 2013

Retrieves the related entity for a specific relationship.

Namespace:   Microsoft.Xrm.Client
Assembly:  Microsoft.Xrm.Client (in Microsoft.Xrm.Client.dll)

Syntax

public static TEntity GetRelatedEntity<TEntity>(
    this Entity entity,
    Relationship relationship
)
where TEntity : Entity
public:
generic<typename TEntity>
where TEntity : Entity
[ExtensionAttribute]
static TEntity GetRelatedEntity(
    Entity^ entity,
    Relationship^ relationship
)
static member GetRelatedEntity<'TEntity when 'TEntity : Entity> : 
        entity:Entity *
        relationship:Relationship -> 'TEntity
<ExtensionAttribute>
Public Shared Function GetRelatedEntity(Of TEntity As Entity) (
    entity As Entity,
    relationship As Relationship
) As TEntity

Parameters

Return Value

Type: TEntity

Type: Entity
The related entity for a specific relationship.

Type Parameters

  • TEntity
    The type, where TEntity is an Entity.

Remarks

Extends the core GetRelatedEntity<TEntity> method.

See Also

GetRelatedEntity Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace

Return to top