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

 

Applies To: Dynamics CRM 2015

Modifies 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 void SetRelatedEntities<TEntity, TResult>(
    this TEntity entity,
    Expression<Func<TEntity, IEnumerable<TResult>>> relationshipSelector,
    IEnumerable<TResult> entities
)
where TEntity : Entity
where TResult : Entity
public:
generic<typename TEntity, typename TResult>
where TEntity : Entity
where TResult : Entity
[ExtensionAttribute]
static void SetRelatedEntities(
    TEntity entity,
    Expression<Func<TEntity, IEnumerable<TResult>^>^>^ relationshipSelector,
    IEnumerable<TResult>^ entities
)
static member SetRelatedEntities<'TEntity, 'TResult when 'TEntity : Entity when 'TResult : Entity> : 
        entity:'TEntity *
        relationshipSelector:Expression<Func<'TEntity, IEnumerable<'TResult>>> *
        entities:IEnumerable<'TResult> -> unit
<ExtensionAttribute>
Public Shared Sub SetRelatedEntities(Of TEntity As Entity, TResult As Entity) (
    entity As TEntity,
    relationshipSelector As Expression(Of Func(Of TEntity, IEnumerable(Of TResult))),
    entities As IEnumerable(Of TResult)
)

Parameters

  • entity
    Type: TEntity

    Type: Entity. The entity instance.

Type Parameters

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

Remarks

Extends the core SetRelatedEntities<TEntity> method.

See Also

SetRelatedEntities Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace

Return to top

© 2017 Microsoft. All rights reserved. Copyright