Hello
I am beginner and I want to really know about how transactions are handles in nopcommerce?(commit & rollback) I checked source code but I am not able to get idea about it.
Can anyone help me please?
Thanks
using (var context = new MyContext())
{
using (var dbContextTransaction = context.Database.BeginTransaction())
{
try
{
// your code
context.SaveChanges();
dbContextTransaction.Commit();
}
catch (Exception)
{
dbContextTransaction.Rollback();
}
}
}
Line 151: _vendorService.InsertVendor(vendor);
Line xxx: ...
Line 154: _urlRecordService.SaveSlug(vendor, seName, 0);
Line xxx: ...
Line 160: _customerService.UpdateCustomer(_workContext.CurrentCustomer);
Line 161:
Line 162: //update picture seo file name
Line 163: UpdatePictureSeoNames(vendor);