Compartilhar via


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

 

Applies To: Dynamics CRM 2013

Retrieves the collection of related entities for a specific relationship.

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

Syntax

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

Parameters

  • entity
    Type: TEntity

    Type: Entity. The entity instance.

Return Value

Type: System.Collections.Generic.IEnumerable<TResult>

Type: IEnumerable<Entity>
The collection of related entities for the relationship.

Type Parameters

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

Remarks

Extends the core GetRelatedEntities<TEntity> method.

See Also

GetRelatedEntities Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace

Return to top