Entity.ToEntity<T> Method ()


Applies To: Dynamics CRM 2015

Gets the entity as the specified type.

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


public T ToEntity<T>()
where T : Entity
generic<typename T>
where T : Entity
T ToEntity()
member ToEntity<'T when 'T : Entity> : unit -> 'T
Public Function ToEntity(Of T As Entity) As T

Return Value

Type: T

Type: Entity
The entity as the specified type.

Type Parameters

  • T
    Type: Entity. The entity type to return.


Account retrievedAccount = service.Retrieve(account.LogicalName, account.Id, new ColumnSet("primarycontactid")).ToEntity<Account>();

See Also

Entity Class
Microsoft.Xrm.Sdk Namespace

Return to top

© 2016 Microsoft. All rights reserved. Copyright