Need to work with transactions , but not working, if i remove transaction code ,works fine
var sms = this.DbContext.SMS.Find(id);
if (this._validation.DeleteValidation(httpContext, id))
{
using (var dbContextTransaction = this.DbContext.Database.BeginTransaction())
{
this.DbContext.SMS.Remove(sms);
if (this.DbContext.SaveChanges() == 1)
{
//error here says the transaction does not exists anymore
dbContextTransaction.Commit();
return true;
}
dbContextTransaction.Rollback();
}
}
Need to work with transactions , but not working, if i remove transaction code ,works fine