|
1234567891011121314151617181920212223242526 |
- using BPA.KitChen.GroupMealOrder.Core.RequestAnalysis;
- using Furion.FriendlyException;
- using SqlSugar;
-
- namespace BPA.KitChen.GroupMealOrder.SqlSugar
- {
- public class SupperRepository: UserAnalysis
- {
- public async Task<T> BaseAction<T>(SqlSugarClient db, Func<T> action, Func<T> 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);
- }
- }
- }
- }
|