AsyncEntitySetController<TEntity, TKey>.CreateEntityAsync Method (TEntity)
This method should be overridden to create a new entity in the entity set.
Namespace: System.Web.Http.OData
Assembly: System.Web.Http.OData (in System.Web.Http.OData.dll)
Syntax
protected internal virtual Task<TEntity> CreateEntityAsync(
TEntity entity
)
public protected:
virtual Task<TEntity>^ CreateEntityAsync(
TEntity entity
)
abstract CreateEntityAsync :
entity:'TEntity -> Task<'TEntity>
override CreateEntityAsync :
entity:'TEntity -> Task<'TEntity>
Protected Friend Overridable Function CreateEntityAsync (
entity As TEntity
) As Task(Of TEntity)
Parameters
entity
Type: TEntityThe entity to add to the entity set.
Return Value
Type: System.Threading.Tasks.Task<TEntity>
A Task that contains the created entity when it completes.
Remarks
When overriding this method, the GetKey method should also be overridden so that the location header can be generated.
See Also
AsyncEntitySetController<TEntity, TKey> Class
System.Web.Http.OData Namespace
Return to top