Compartilhar via


EntityExtensions.GetRelatedEntity<TEntity, TResult> Method (TEntity, OrganizationServiceContext, Expression<Func<TEntity, TResult>>)

 

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 TResult GetRelatedEntity<TEntity, TResult>(
    this TEntity entity,
    OrganizationServiceContext context,
    Expression<Func<TEntity, TResult>> relationshipSelector
)
where TEntity : Entity
where TResult : Entity
public:
generic<typename TEntity, typename TResult>
where TEntity : Entity
where TResult : Entity
[ExtensionAttribute]
static TResult GetRelatedEntity(
    TEntity entity,
    OrganizationServiceContext^ context,
    Expression<Func<TEntity, TResult>^>^ relationshipSelector
)
static member GetRelatedEntity<'TEntity, 'TResult when 'TEntity : Entity when 'TResult : Entity> : 
        entity:'TEntity *
        context:OrganizationServiceContext *
        relationshipSelector:Expression<Func<'TEntity, 'TResult>> -> 'TResult
<ExtensionAttribute>
Public Shared Function GetRelatedEntity(Of TEntity As Entity, TResult As Entity) (
    entity As TEntity,
    context As OrganizationServiceContext,
    relationshipSelector As Expression(Of Func(Of TEntity, TResult))
) As TResult

Parameters

  • entity
    Type: TEntity

    Type: Entity. The entity instance.

Return Value

Type: TResult

Type: Entity
The related entity for a specific relationship.

Type Parameters

  • TEntity
    The type, where TEntity is an Entity.
  • TResult

Remarks

Extends the core GetRelatedEntity<TEntity> method.

See Also

GetRelatedEntity Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace

Return to top