OrganizationServiceContextExtensions.AttachClone<T> Method (OrganizationServiceContext, T, Boolean)


Applies To: Dynamics CRM 2015

Clones an arbitrary source entity and attaches it to the context.

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


public static T AttachClone<T>(
    this OrganizationServiceContext context,
    T entity,
    bool includeRelatedEntities = false
where T : Entity
generic<typename T>
where T : Entity
static T AttachClone(
    OrganizationServiceContext^ context,
    T entity,
    bool includeRelatedEntities = false
static member AttachClone<'T when 'T : Entity> : 
        context:OrganizationServiceContext *
        entity:'T *
        includeRelatedEntities:bool = false -> 'T
Public Shared Function AttachClone(Of T As Entity) (
    context As OrganizationServiceContext,
    entity As T,
    includeRelatedEntities As Boolean
) As T


  • entity
    Type: T

    Type: Entity. The entity instance.

  • includeRelatedEntities
    Type: System.Boolean

    Type: Boolean. Specifies whether to include related entity instances.

Return Value

Type: T

Type: T where T is Entity
.The resulting entity.

Type Parameters

See Also

OrganizationServiceContextExtensions Class
Microsoft.Xrm.Client Namespace
Developer extensions for Microsoft Dynamics CRM 2015
Attach entities to the context (Dynamics CRM 2015)

Return to top

© 2017 Microsoft. All rights reserved. Copyright