Class FluentTransactionExtension
Contains all fluent operations as extension method
Inheritance
Inherited Members
Namespace: Simplic.Data
Assembly: Simplic.Data.dll
Syntax
public static class FluentTransactionExtension
Methods
| Improve this Doc View SourceAbortAsync(IFluentTransactionBuilder)
Abort the actual transaction and undo changes
Declaration
public static async Task AbortAsync(this IFluentTransactionBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IFluentTransactionBuilder | builder | Actual builder instance |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
AddService<TService, TModel, TId>(IFluentTransactionBuilder, TService)
Add a service to the actual fluent builder
Declaration
public static IFluentTransactionBuilder AddService<TService, TModel, TId>(this IFluentTransactionBuilder builder, TService service)
where TService : ITransactionRepository<TModel, TId> where TModel : new()
Parameters
Type | Name | Description |
---|---|---|
IFluentTransactionBuilder | builder | Actual builder instance |
TService | service | Service to register/add |
Returns
Type | Description |
---|---|
IFluentTransactionBuilder | The builder instance that was passed to the method |
Type Parameters
Name | Description |
---|---|
TService | Service type |
TModel | Object type |
TId | Object unique id type |
CommitAsync(IFluentTransactionBuilder)
Commit all operations
Declaration
public static async Task CommitAsync(this IFluentTransactionBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IFluentTransactionBuilder | builder | Actual builder instance |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Create<TService, TModel, TId>(IFluentTransactionBuilder, Func<ITransactionRepository<TModel, TId>, TModel>)
Calls the create method from a service
Declaration
public static IFluentTransactionBuilder Create<TService, TModel, TId>(this IFluentTransactionBuilder builder, Func<ITransactionRepository<TModel, TId>, TModel> func)
where TService : ITransactionRepository<TModel, TId> where TModel : new()
Parameters
Type | Name | Description |
---|---|---|
IFluentTransactionBuilder | builder | Actual builder instance |
System.Func<ITransactionRepository<TModel, TId>, TModel> | func | Delegate for getting the data to create |
Returns
Type | Description |
---|---|
IFluentTransactionBuilder | The builder instance that was passed to the method |
Type Parameters
Name | Description |
---|---|
TService | Service type |
TModel | Object type |
TId | Object unique id type |
Delete<TService, TModel, TId>(IFluentTransactionBuilder, Func<ITransactionRepository<TModel, TId>, TId>)
Calls the delete method from a service
Declaration
public static IFluentTransactionBuilder Delete<TService, TModel, TId>(this IFluentTransactionBuilder builder, Func<ITransactionRepository<TModel, TId>, TId> func)
where TService : ITransactionRepository<TModel, TId> where TModel : new()
Parameters
Type | Name | Description |
---|---|---|
IFluentTransactionBuilder | builder | Actual builder instance |
System.Func<ITransactionRepository<TModel, TId>, TId> | func | Delegate for getting the id of the data to delete |
Returns
Type | Description |
---|---|
IFluentTransactionBuilder | The builder instance that was passed to the method |
Type Parameters
Name | Description |
---|---|
TService | Service type |
TModel | Object type |
TId | Object unique id type |
Update<TService, TModel, TId>(IFluentTransactionBuilder, Func<ITransactionRepository<TModel, TId>, TModel>)
Calls the update method from a service
Declaration
public static IFluentTransactionBuilder Update<TService, TModel, TId>(this IFluentTransactionBuilder builder, Func<ITransactionRepository<TModel, TId>, TModel> func)
where TService : ITransactionRepository<TModel, TId> where TModel : new()
Parameters
Type | Name | Description |
---|---|---|
IFluentTransactionBuilder | builder | Actual builder instance |
System.Func<ITransactionRepository<TModel, TId>, TModel> | func | Delegate for getting the data to update |
Returns
Type | Description |
---|---|
IFluentTransactionBuilder | The builder instance that was passed to the method |
Type Parameters
Name | Description |
---|---|
TService | Service type |
TModel | Object type |
TId | Object unique id type |