修复错误

This commit is contained in:
2025-07-21 22:02:42 +08:00
parent 525c681b6c
commit 8f3543afb5
33 changed files with 428 additions and 260 deletions

View File

@@ -1,4 +1,6 @@
using System.Diagnostics;
using AutoMapper;
using DMS.Core.Helper;
using DMS.Core.Interfaces.Repositories;
using DMS.Core.Models;
using DMS.Infrastructure.Data;
@@ -38,4 +40,15 @@ public class DeviceRepository : BaseRepository<DbDevice>, IDeviceRepository
public async Task<int> DeleteAsync(Device model) => await base.DeleteAsync(_mapper.Map<DbDevice>(model));
public async Task<int> DeleteAsync(int id)
{
var stopwatch = new Stopwatch();
stopwatch.Start();
var result = await Db.Deleteable(new DbDevice() { Id = id })
.ExecuteCommandAsync();
stopwatch.Stop();
NlogHelper.Info($"Delete {typeof(DbDevice)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
return result;
}
}