How to use the transaction

Sep 19, 2012 at 9:42 AM
Edited Sep 19, 2012 at 9:43 AM
I have a question,that is
addlist(T list)
{
using (var context = Context().UseTransaction)
{
	context.Sql("update Product set Name = @0 where ProductId = @1")
				.Parameters("The Warren Buffet Way", 1)
				.Execute();
for(var item in list)
{
//Here's code segment can not be executed
context .Insert("Product ")
        .Column("something", item. something)
        .Execute();
}
	context.Commit();
}

}

Have you come across it? thank you

Sep 19, 2012 at 10:00 AM

I understand, I use a static variable to instantiate, DbContext ()