TransactionKit Class

The factory that creates queries.

C#
public sealed class TransactionKit
Inheritance
TransactionKit

Constructors

TransactionKit(string, Action<Func<string>>)

The factory that creates queries.

Methods

Execute(Action<Query>)

Executes queries within a single transaction.

Execute<T>(Func<Query, T>)

Executes queries within a single transaction and returns the result.

Equals(object) (Inherited from object)
GetHashCode() (Inherited from object)
GetType() (Inherited from object)
MemberwiseClone() (Inherited from object)
ToString() (Inherited from object)

Constructors Detail

TransactionKit(string, Action<Func<string>>)

The factory that creates queries.

C#
public TransactionKit(string databasePath, Action<Func<string>> logger)

Parameters

databasePath
string

The path of the database file.

logger
Action<Func<string>>

The logger.

Methods Detail

Execute(Action<Query>)

Executes queries within a single transaction.

C#
public void Execute(Action<Query> action)

Parameters

action
Action<Query>

The action that takes a Query object.

Remarks

If the action throws an exception, this method performs the rollback.

Execute<T>(Func<Query, T>)

Executes queries within a single transaction and returns the result.

C#
public T Execute<T>(Func<Query, T> apply)

Type Parameters

T

The type of the result.

Parameters

apply
Func<Query, T>

The function that takes a Query object and returns the result.

Returns

T

The result.

Remarks

If the apply throws an exception, this method performs the rollback.