refactor:删除不必要的方法
This commit is contained in:
@@ -90,21 +90,7 @@ public class MenuRepository : BaseRepository<DbMenu>, IMenuRepository
|
||||
/// <returns>受影响的行数。</returns>
|
||||
public async Task<int> DeleteAsync(MenuBean entity) => await base.DeleteAsync(new List<DbMenu> { _mapper.Map<DbMenu>(entity) });
|
||||
|
||||
/// <summary>
|
||||
/// 异步根据ID删除菜单。
|
||||
/// </summary>
|
||||
/// <param name="id">要删除菜单的唯一标识符。</param>
|
||||
/// <returns>受影响的行数。</returns>
|
||||
public async Task<int> DeleteByIdAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await _dbContext.GetInstance().Deleteable(new DbMenu { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
_logger.LogInformation($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 异步根据菜单ID删除菜单树(包括子菜单)。
|
||||
@@ -161,16 +147,6 @@ public class MenuRepository : BaseRepository<DbMenu>, IMenuRepository
|
||||
return _mapper.Map<MenuBean>(dbMenu);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步获取指定数量的菜单。
|
||||
/// </summary>
|
||||
/// <param name="number">要获取的菜单数量。</param>
|
||||
/// <returns>包含指定数量菜单实体的列表。</returns>
|
||||
public new async Task<List<MenuBean>> TakeAsync(int number)
|
||||
{
|
||||
var dbList = await base.TakeAsync(number);
|
||||
return _mapper.Map<List<MenuBean>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<List<MenuBean>> AddBatchAsync(List<MenuBean> entities)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user