|
- using BPA.KitChen.StoreManagementOrder.Core.RequestAnalysis;
- using Furion.FriendlyException;
- using SqlSugar;
-
- namespace BPA.KitChen.StoreManagementOrder.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);
- }
- }
- }
- }
|