共用方式為


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

 

Applies To: Dynamics CRM 2013

Modifies a related entity for a specific relationship.

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

Syntax

public static void SetRelatedEntity<TEntity, TResult>(
    this TEntity entity,
    Expression<Func<TEntity, TResult>> relationshipSelector,
    TResult value
)
where TEntity : Entity
where TResult : Entity
public:
generic<typename TEntity, typename TResult>
where TEntity : Entity
where TResult : Entity
[ExtensionAttribute]
static void SetRelatedEntity(
    TEntity entity,
    Expression<Func<TEntity, TResult>^>^ relationshipSelector,
    TResult value
)
static member SetRelatedEntity<'TEntity, 'TResult when 'TEntity : Entity when 'TResult : Entity> : 
        entity:'TEntity *
        relationshipSelector:Expression<Func<'TEntity, 'TResult>> *
        value:'TResult -> unit
<ExtensionAttribute>
Public Shared Sub SetRelatedEntity(Of TEntity As Entity, TResult As Entity) (
    entity As TEntity,
    relationshipSelector As Expression(Of Func(Of TEntity, TResult)),
    value As TResult
)

Parameters

  • entity
    Type: TEntity

    Type: Entity. The entity instance.

  • value
    Type: TResult

    Type: TEntity, where TEntity is an Entity. The entity instance to be related.

Type Parameters

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

Remarks

Extends the core SetRelatedEntity<TEntity> method.

See Also

SetRelatedEntity Overload
EntityExtensions Class
Microsoft.Xrm.Client Namespace

Return to top