refactor:删除不必要的方法
This commit is contained in:
@@ -77,33 +77,7 @@ public class UserRepository : BaseRepository<DbUser>, IUserRepository
|
||||
/// <returns>受影响的行数。</returns>
|
||||
public async Task<int> DeleteAsync(User entity) => await base.DeleteAsync(new List<DbUser> { _mapper.Map<DbUser>(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 DbUser() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
_logger.LogInformation($"Delete {typeof(DbUser)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步获取指定数量的用户。
|
||||
/// </summary>
|
||||
/// <param name="number">要获取的用户数量。</param>
|
||||
/// <returns>包含指定数量用户实体的列表。</returns>
|
||||
public new async Task<List<User>> TakeAsync(int number)
|
||||
{
|
||||
var dbList = await base.TakeAsync(number);
|
||||
return _mapper.Map<List<User>>(dbList);
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<User>> AddBatchAsync(List<User> entities)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user