Using Transactions : Simple.Data Help

Simple.Data

Simple.Data is a lightweight framework that uses the dynamic features of .NET 4 to provide an expressive, ORM-ish way of accessing and manipulating data without any of the code pre-generation and boilerplate required by other frameworks.

Transactions

Transactions are transparent in Simple.Data and very simple to achieve. They are supported on all CRUD operations.

using (var transaction = database.BeginTransaction())
{
   transaction.Users.Insert(Name: "Steve", Age: 50);
   transaction.Commit();
}

Generates the following SQL

@p0 (AnsiString) = Steve
@p1 (AnsiString) = 50
insert into [dbo].[Users] ([Name],[Age]) values (@p0,@p1)