refactor:删除不必要的方法
This commit is contained in:
@@ -77,33 +77,8 @@ public class MqttAliasRepository : BaseRepository<DbMqttAlias>, IMqttAliasReposi
|
||||
/// <returns>受影响的行数。</returns>
|
||||
public async Task<int> DeleteAsync(MqttAlias entity) => await base.DeleteAsync(new List<DbMqttAlias> { _mapper.Map<DbMqttAlias>(entity) });
|
||||
|
||||
/// <summary>
|
||||
/// 异步根据ID删除变量与MQTT别名关联。
|
||||
/// </summary>
|
||||
/// <param name="id">要删除变量与MQTT别名关联的唯一标识符。</param>
|
||||
/// <returns>受影响的行数。</returns>
|
||||
public async Task<int> DeleteByIdAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await _dbContext.GetInstance().Deleteable(new DbMqttAlias() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
_logger.LogInformation($"Delete {typeof(DbMqttAlias)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步获取指定数量的变量与MQTT别名关联。
|
||||
/// </summary>
|
||||
/// <param name="number">要获取的变量与MQTT别名关联数量。</param>
|
||||
/// <returns>包含指定数量变量与MQTT别名关联实体的列表。</returns>
|
||||
public new async Task<List<MqttAlias>> TakeAsync(int number)
|
||||
{
|
||||
var dbList = await base.TakeAsync(number);
|
||||
return _mapper.Map<List<MqttAlias>>(dbList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async Task<List<MqttAlias>> AddBatchAsync(List<MqttAlias> entities)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user