using (DbContextTransaction transaction = context.Database.BeginTransaction())
{
try
{
List<TechnicalReviewInfo> currentTR = context.TechnicalReviewInfo.Where(x => x.Guid == info.Guid && x.IsDelete == false).ToList();
foreach (TechnicalReviewInfo item in currentTR)
{
item.IsDelete = true;
}
context.TechnicalReviewInfo.Add(info);
context.WorkStep.Add(currentStep);
context.SaveChanges();

nextStep.PreStepId = currentStep.Id;
//throw new Exception();
context.WorkStep.Add(nextStep);
count = context.SaveChanges();
transaction.Commit();
}
catch (Exception)
{
transaction.Rollback();

}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2021-09-16
  • 2022-02-20
  • 2021-11-14
  • 2021-08-19
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-09-05
  • 2021-12-14
  • 2021-08-01
  • 2022-12-23
相关资源
相似解决方案