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