Entity.ToEntity Entity.ToEntity Entity.ToEntity Entity.ToEntity Method

Definition

Gets the entity as the specified type.

public:
generic <typename T>
 where T : Microsoft::Xrm::Sdk::Entity T ToEntity();
public T ToEntity<T> () where T : Microsoft.Xrm.Sdk.Entity;
member this.ToEntity : unit -> 'T (requires 'T :> Microsoft.Xrm.Sdk.Entity)
Public Function ToEntity(Of T As Entity) () As T

Type Parameters

T

Type: Entity. The entity type to return.

Returns

T T T T

Type: EntityThe entity as the specified type.

Examples


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

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

Applies to