添加事务、完善注释
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Yi.Framework.Repository
|
||||
public interface IRepository<T> : ISimpleClient<T> where T : BaseModelEntity,new()
|
||||
{
|
||||
public ISqlSugarClient _Db { get; set; }
|
||||
public Task<bool> UseTranAsync(Func<Task> func);
|
||||
public Task<T> InsertReturnEntityAsync(T entity);
|
||||
public Task<List<S>> StoreAsync<S>(string storeName, object para);
|
||||
public Task<PageModel<List<T>>> CommonPageAsync(QueryPageCondition pars);
|
||||
|
||||
@@ -24,6 +24,18 @@ namespace Yi.Framework.Repository
|
||||
_Db = context;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步事务
|
||||
/// </summary>
|
||||
/// <param name="func"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> UseTranAsync(Func<Task> func)
|
||||
{
|
||||
var res = await Db.AsTenant().UseTranAsync(func);
|
||||
return res.IsSuccess;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加返回实体
|
||||
|
||||
Reference in New Issue
Block a user