Transactions - activa/iridium GitHub Wiki
Transactions can be implemented by creating a Transaction object and calling Commit() or Rollback() on the object:
using (var transaction = new Transaction(dbContext))
{
dbContext.Insert(new Product() {...});
transaction.Commit();
}
using (var transaction = new Transaction(dbContext))
{
dbContext.Insert(new Product() {...});
transaction.Rollback();
}
If Commit() isn't called before the transaction object is disposed, an implicit rollback is performed.