sadaf_
دوشنبه 07 مرداد 1392, 23:43 عصر
اگر بخواهیم از SqlTransaction در EF استفاده کنیم
چطوری باید کدنویسی کرد
ممنون
esafb52
سه شنبه 08 مرداد 1392, 03:46 صبح
اینجوری
using (var context = new BlahEntities())
using (var tx = context.BeginTransaction())
{
// do db stuff here...
try
{
tx.Commit();
}
catch (Exception)
{
tx.rollback();
}
}
البته خودم استفاده نکردم
اینجا رو ببین
:http://stackoverflow.com/questions/1054980/how-to-use-transactions-with-the-entity-framework?rq=1
vBulletin® v4.2.5, Copyright ©2000-1403, Jelsoft Enterprises Ltd.