using BPA.KitChen.GroupMealOrder.Core.RequestAnalysis; using Furion.FriendlyException; using SqlSugar; namespace BPA.KitChen.GroupMealOrder.SqlSugar { public class SupperRepository: UserAnalysis { public async Task BaseAction(SqlSugarClient db, Func action, Func defualtActoion, string msg) { try { db.BeginTran(); var res = action.Invoke(); db.CommitTran(); return await Task.FromResult(res); } catch (Exception ex) { db.RollbackTran(); //BPALog.WriteLog(msg + ":" + ex.Message, LogEnum.Error, null, ex); throw Oops.Oh(ex.Message); } } } }