Class BulkUpdateCommand
Base class for bulk update commands.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Data.Commands
Assembly: Kephas.Data.dll
Syntax
[DataContextType(typeof(DataContextBase))]
public class BulkUpdateCommand : BulkOperationCommandBase<IBulkUpdateContext, IBulkDataOperationResult>, ILoggable, IBulkUpdateCommand, IDataCommand<IBulkUpdateContext, IBulkDataOperationResult>, IDataCommand, IAsyncOperation
Methods
| Improve this Doc View SourceBulkUpdateAsync<T>(IBulkUpdateContext, CancellationToken)
Updates the entities matching the provided criteria and returns the number of affected entities.
Declaration
protected virtual Task<IBulkDataOperationResult> BulkUpdateAsync<T>(IBulkUpdateContext bulkUpdateContext, CancellationToken cancellationToken)
where T : class
Parameters
Type | Name | Description |
---|---|---|
IBulkUpdateContext | bulkUpdateContext | The bulk update context. |
System.Threading.CancellationToken | cancellationToken | Optional. The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IBulkDataOperationResult> | A promise of the number of updated entities. |
Type Parameters
Name | Description |
---|---|
T | The type of the entity. |
BulkUpdateCoreAsync<T>(IBulkUpdateContext, Expression<Func<T, Boolean>>, IDictionary<String, Object>, CancellationToken)
Updates the entities matching the provided criteria and returns the number of affected entities.
Declaration
protected virtual Task<long> BulkUpdateCoreAsync<T>(IBulkUpdateContext bulkDeleteContext, Expression<Func<T, bool>> criteria, IDictionary<string, object> values, CancellationToken cancellationToken)
where T : class
Parameters
Type | Name | Description |
---|---|---|
IBulkUpdateContext | bulkDeleteContext | The bulk delete context. |
System.Linq.Expressions.Expression<System.Func<T, System.Boolean>> | criteria | The criteria for finding the entities to operate on. |
System.Collections.Generic.IDictionary<System.String, System.Object> | values | The values. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int64> | A promise of the number of updated entities. |
Type Parameters
Name | Description |
---|---|
T | The type of the entity. |
ExecuteAsync(IBulkUpdateContext, CancellationToken)
Executes the data command asynchronously.
Declaration
public override Task<IBulkDataOperationResult> ExecuteAsync(IBulkUpdateContext operationContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IBulkUpdateContext | operationContext | The operation context. |
System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IBulkDataOperationResult> | A promise of a IDataCommandResult. |
Overrides
UpdateEntity<T>(T, IDictionary<String, Object>)
Updates the entity with the values in the dictionary.
Declaration
protected virtual void UpdateEntity<T>(T entity, IDictionary<string, object> values)
Parameters
Type | Name | Description |
---|---|---|
T | entity | The entity. |
System.Collections.Generic.IDictionary<System.String, System.Object> | values | The values. |
Type Parameters
Name | Description |
---|---|
T | The entity type. |