Class FluentTransactionBuilder
Builds and stores all information for a transaction that is represented in fluent-style
Inheritance
System.Object
FluentTransactionBuilder
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Data
Assembly: Simplic.Data.dll
Syntax
public class FluentTransactionBuilder : IFluentTransactionBuilder
Constructors
| Improve this Doc View SourceFluentTransactionBuilder(ITransactionService)
Initialize transaction builder
Declaration
public FluentTransactionBuilder(ITransactionService transactionService)
Parameters
Type | Name | Description |
---|---|---|
ITransactionService | transactionService | Transaction service instance |
Properties
| Improve this Doc View SourceTasks
Gets the actual list of tasks to execute when committing or aborting
Declaration
public IList<Func<Task>> Tasks { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Func<System.Threading.Tasks.Task>> |
TransactionService
Gets the transaction service for executing transaction operations on commit and abort
Declaration
public ITransactionService TransactionService { get; }
Property Value
Type | Description |
---|---|
ITransactionService |
Methods
| Improve this Doc View SourceAddService<TModel, TId>(ITransactionRepository<TModel, TId>)
Adds a service-instance to the current builder
Declaration
public void AddService<TModel, TId>(ITransactionRepository<TModel, TId> service)
where TModel : new()
Parameters
Type | Name | Description |
---|---|---|
ITransactionRepository<TModel, TId> | service | Service instance |
Type Parameters
Name | Description |
---|---|
TModel | Object type |
TId | Unique id type |
GetService<TModel, TId>()
Gets a service from the builder
Declaration
public ITransactionRepository<TModel, TId> GetService<TModel, TId>()
where TModel : new()
Returns
Type | Description |
---|---|
ITransactionRepository<TModel, TId> | Service instance |
Type Parameters
Name | Description |
---|---|
TModel | Object type |
TId | Unique id type |
GetTransaction()
Creates a new transaction if no transaction is existing. Only one instance will be created during builder-lifetime.
Declaration
public async Task<ITransaction> GetTransaction()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ITransaction> | Transaction instance |