TransactionlessUnitOfWork class
namespace: Serenity.Data assembly: Serenity.Net.Services
A unit of work implementation without an underlying actual transaction. Use with care, only to pass an IUnitOfWork instance to some methods where you don't want to actually start a transaction.
public class TransactionlessUnitOfWork : IDisposable, IUnitOfWork
| parameter | description |
|---|---|
| connection | The connection. |
Public Members
| name | description |
|---|---|
| TransactionlessUnitOfWork(…) | A unit of work implementation without an underlying actual transaction. Use with care, only to pass an IUnitOfWork instance to some methods where you don't want to actually start a transaction. |
| Connection { get; } | Gets the connection. |
| event OnCommit | Occurs when Commit is called as there is no underlying transaction. |
| event OnRollback | Occurs when Dispose is called as there is no underlying transaction. |
| Commit() | Does nothing other than calling onCommit events as there is no underlying transaction. |
| Dispose() | Invokes the rollback events, as there is no underlying transaction to roll back. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | connection |
Remarks
Initializes a new instance of the class.
See Also
- interface IUnitOfWork
- Source: TransactionlessUnitOfWork.cs