Show / Hide Table of Contents

Interface IBatchManager

Provides an interface for batch managers.

Namespace: Paradigm.ORM.Data.Batching
Assembly: Paradigm.ORM.Data.dll
Syntax
public interface IBatchManager : IDisposable
Remarks

The function of a batch manager is to manage secuential batches that may require actions inbetween. For example when saving a list of entities, if the entities have children, we need to execute the first batch of parents, then extract the ids, set the ids on children, and then execute the second batch for the children.

Properties

| Improve this Doc View Source

MaxCount

Gets or sets the maximum count of command steps per batch.

Declaration
int MaxCount { get; set; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Add(ICommandBatchStep)

Adds the specified command to the current batch.

Declaration
IBatchManager Add(ICommandBatchStep command)
Parameters
Type Name Description
ICommandBatchStep command

The command.

Returns
Type Description
IBatchManager

Returns the batch manager instance.

| Improve this Doc View Source

AddNewBatch()

Adds a new batch to the manager.

Declaration
IBatchManager AddNewBatch()
Returns
Type Description
IBatchManager

Returns the batch manager instance.

Remarks

The batch manager can handle several batches. When adding commands to manager, the manager will add the command to the current active batch manager as new batch step.

| Improve this Doc View Source

AddNewBatch(Action)

Adds a new batch to the manager.

Declaration
IBatchManager AddNewBatch(Action action)
Parameters
Type Name Description
Action action

The action.

Returns
Type Description
IBatchManager

Returns the batch manager instance.

Remarks

The batch manager can handle several sequential batches. When adding commands to manager, the manager will add the command to the current active batch as a new batch step.

| Improve this Doc View Source

AddNewBatch(Func<Task>)

Adds a new batch to the manager.

Declaration
IBatchManager AddNewBatch(Func<Task> action)
Parameters
Type Name Description
Func<Task> action

The action.

Returns
Type Description
IBatchManager

Returns the batch manager instance.

Remarks

The batch manager can handle several sequential batches. When adding commands to manager, the manager will add the command to the current active batch as a new batch step.

| Improve this Doc View Source

Execute()

Executes all the batch steps.

Declaration
void Execute()
| Improve this Doc View Source

ExecuteAsync()

Executes all the batch steps.

Declaration
Task ExecuteAsync()
Returns
Type Description
Task
| Improve this Doc View Source

Reset()

Resets the batch manager. All the steps and command will be cleared.

Declaration
void Reset()

Extension Methods

ObjectExtensions.ThrowIfFails<TException>(Object, Action, String)
ObjectExtensions.ThrowIfFails<TException, TResult>(Object, Func<TResult>, String)
ObjectExtensions.ThrowIfFailsAsync<TException>(Object, Func<Task>, String)
ObjectExtensions.ThrowIfFailsAsync<TException, TResult>(Object, Func<Task<TResult>>, String)

See Also

Paradigm.ORM.Data.Batching.ICommandBatch
ICommandBatchStep
  • Improve this Doc
  • View Source
Powered by MiracleDevs ©2017. Code licensed under the MIT License.
Documentation generated by DocFX.