Adds UnitOfWork pattern support to NPoco
GetUnitOfWork() : IUnitOfWork
Commit() : void
Database : IDatabase
Allows you to do multiple database operations in a transaction. Uses IDisposable interface and disposing the object will rollback the transaction unless Commit() is called first.
using(var unitOfWork = _unitOfWorkProvider.GetUnitOfWork())
{
// Do operations with the database like
unitOfWork.Database.Insert(objectToInsert)
unitOfWork.Commit();
}
Returns an NPoco IDatabase object
GetDatabase(): IDatabase