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