Entity.ToEntity<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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<Account>();