Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 666 Bytes

README.md

File metadata and controls

37 lines (26 loc) · 666 Bytes

Gibe.NPoco

Adds UnitOfWork pattern support to NPoco

IUnitOfWorkProvider

GetUnitOfWork() : IUnitOfWork

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.

Sample usage:

using(var unitOfWork = _unitOfWorkProvider.GetUnitOfWork()) 
{
    // Do operations with the database like
    unitOfWork.Database.Insert(objectToInsert)

    unitOfWork.Commit();
}

IDatabaseProvider

Returns an NPoco IDatabase object

GetDatabase(): IDatabase