Show / Hide Table of Contents

Class BatchManager

Represent a batch manager.

Inheritance
System.Object
BatchManager
Implements
IBatchManager
IDisposable
Namespace: Paradigm.ORM.Data.Batching
Assembly: Paradigm.ORM.Data.dll
Syntax
public class BatchManager : object, 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.

Constructors

| Improve this Doc View Source

BatchManager(IDatabaseConnector)

Initializes a new instance of the BatchManager class.

Declaration
public BatchManager(IDatabaseConnector connector)
Parameters
Type Name Description
IDatabaseConnector connector

The database connector.

Properties

| Improve this Doc View Source

MaxCount

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

Declaration
public 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
public 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
public 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
public 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
public 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

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

Execute()

Executes all the batch steps.

Declaration
public void Execute()
| Improve this Doc View Source

ExecuteAsync()

Executes all the batch steps.

Declaration
public 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
public void Reset()

Implements

IBatchManager
IDisposable

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

IBatchManager
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.