Language

Entity.ToEntity Method

Definition

Gets the entity as the specified type.

public:
generic 
 where T : Microsoft::Xrm::Sdk::Entity T ToEntity();
public T ToEntity() 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

The entity type to return.

Returns

T

The entity as the specified type.

Examples

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

Applies to