I have to insert data in multiple tables using entity framework so I want to use transection scope for that please guide me how to use transection with entity framework 6?
How to use transection with entity framework 6?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Feb 17, 2015, 6:40 PM EST
Hi Namit Kumar,
You can use tranj using following syntax-
using (var transaction = db.Database.BeginTransaction())
{
try
{
// TODO: Add insert logic here
db.SaveChanges();
transaction.Commit();
}
}
catch (Exception ex)
{
transaction.Rollback();
}
}
Or go through following article it will help you.
http://www.c-sharpcorner.com/UploadFile/ff2f08/working-with-transaction-in-entity-framework-6-0/