Interface IInsertCommand<TEntity>
Represents a command which performs insertions of entities.
Namespace: Venflow.Commands
Assembly: Venflow.dll
Syntax
public interface IInsertCommand<TEntity> : IVenflowCommand<TEntity>, IAsyncDisposable where TEntity : class, new()
Type Parameters
| Name | Description |
|---|---|
| TEntity | The type of the entity which will be inserted. |
Methods
| Improve this Doc View SourceInsertAsync(TEntity, CancellationToken)
Asynchronously inserts a single entity.
Declaration
Task<int> InsertAsync(TEntity entity, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| TEntity | entity | The entity instance which should be inserted. |
| CancellationToken | cancellationToken | The cancellation token, which is used to cancel the operation |
Returns
| Type | Description |
|---|---|
| Task<Int32> | A task representing the asynchronous operation, with the number of rows affected if known; 0 otherwise. |
InsertAsync(IList<TEntity>, CancellationToken)
Asynchronously inserts a set of entities.
Declaration
Task<int> InsertAsync(IList<TEntity> entities, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<TEntity> | entities | The entity instances which should be inserted. |
| CancellationToken | cancellationToken | The cancellation token, which is used to cancel the operation |
Returns
| Type | Description |
|---|---|
| Task<Int32> | A task representing the asynchronous operation, with the number of rows affected if known; 0 otherwise. |