refactor:删除不必要的方法
This commit is contained in:
@@ -93,50 +93,7 @@ public class VariableRepository : BaseRepository<DbVariable>, IVariableRepositor
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <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 DbVariable() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
_logger.LogInformation($"Delete {typeof(DbVariable)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步根据ID列表批量删除变量。
|
||||
/// </summary>
|
||||
/// <param name="ids">要删除变量的唯一标识符列表。</param>
|
||||
/// <returns>受影响的行数。</returns>
|
||||
public async Task<int> DeleteByIdsAsync(List<int> ids)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await _dbContext.GetInstance().Deleteable<DbVariable>()
|
||||
.In(ids)
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
_logger.LogInformation($"Delete {typeof(DbVariable)},Count={ids.Count},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步获取指定数量的变量。
|
||||
/// </summary>
|
||||
/// <param name="number">要获取的变量数量。</param>
|
||||
/// <returns>包含指定数量变量实体的列表。</returns>
|
||||
public new async Task<List<Variable>> TakeAsync(int number)
|
||||
{
|
||||
var dbList = await base.TakeAsync(number);
|
||||
return _mapper.Map<List<Variable>>(dbList);
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<Variable>> AddBatchAsync(List<Variable> entities)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user