团餐订单
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 line
777 B

  1. using BPA.KitChen.GroupMealOrder.Core.RequestAnalysis;
  2. using Furion.FriendlyException;
  3. using SqlSugar;
  4. namespace BPA.KitChen.GroupMealOrder.SqlSugar
  5. {
  6. public class SupperRepository: UserAnalysis
  7. {
  8. public async Task<T> BaseAction<T>(SqlSugarClient db, Func<T> action, Func<T> defualtActoion, string msg)
  9. {
  10. try
  11. {
  12. db.BeginTran();
  13. var res = action.Invoke();
  14. db.CommitTran();
  15. return await Task.FromResult(res);
  16. }
  17. catch (Exception ex)
  18. {
  19. db.RollbackTran();
  20. //BPALog.WriteLog(msg + ":" + ex.Message, LogEnum.Error, null, ex);
  21. throw Oops.Oh(ex.Message);
  22. }
  23. }
  24. }
  25. }