修复错误
This commit is contained in:
@@ -80,6 +80,7 @@ public abstract class BaseRepository<TEntity>
|
||||
NlogHelper.Info($"Delete {typeof(TEntity).Name}耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 异步获取所有实体。
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -31,13 +31,37 @@ public class MenuRepository : BaseRepository<DbMenu>, IMenuRepository
|
||||
}
|
||||
|
||||
|
||||
public async Task<MenuBean> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<MenuBean> GetByIdAsync(int id)
|
||||
{
|
||||
var dbMenu = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<MenuBean>(dbMenu);
|
||||
}
|
||||
|
||||
public async Task<List<MenuBean>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<MenuBean>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<MenuBean>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<MenuBean> AddAsync(MenuBean entity) => throw new NotImplementedException();
|
||||
public async Task<MenuBean> AddAsync(MenuBean entity)
|
||||
{
|
||||
var dbMenu = await base.AddAsync(_mapper.Map<DbMenu>(entity));
|
||||
return _mapper.Map(dbMenu, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(MenuBean entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(MenuBean entity) => await base.UpdateAsync(_mapper.Map<DbMenu>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(MenuBean entity) => throw new NotImplementedException();
|
||||
|
||||
public async Task<int> DeleteAsync(MenuBean entity) => await base.DeleteAsync(_mapper.Map<DbMenu>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new DbMenu { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using AutoMapper;
|
||||
using DMS.Core.Helper;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
@@ -12,18 +13,44 @@ namespace DMS.Infrastructure.Repositories;
|
||||
/// </summary>
|
||||
public class MqttServerRepository : BaseRepository<DbMqttServer>, IMqttServerRepository
|
||||
{
|
||||
public MqttServerRepository(SqlSugarDbContext dbContext)
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public MqttServerRepository(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public async Task<MqttServer> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<MqttServer> GetByIdAsync(int id)
|
||||
{
|
||||
var dbMqttServer = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<MqttServer>(dbMqttServer);
|
||||
}
|
||||
|
||||
public async Task<List<MqttServer>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<MqttServer>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<MqttServer>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<MqttServer> AddAsync(MqttServer entity) => throw new NotImplementedException();
|
||||
public async Task<MqttServer> AddAsync(MqttServer entity)
|
||||
{
|
||||
var dbMqttServer = await base.AddAsync(_mapper.Map<DbMqttServer>(entity));
|
||||
return _mapper.Map(dbMqttServer, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(MqttServer entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(MqttServer entity) => await base.UpdateAsync(_mapper.Map<DbMqttServer>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(MqttServer entity) => throw new NotImplementedException();
|
||||
public async Task<int> DeleteAsync(MqttServer entity) => await base.DeleteAsync(_mapper.Map<DbMqttServer>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new MqttServer() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(MqttServer)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using AutoMapper;
|
||||
using DMS.Core.Interfaces;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Infrastructure.Data;
|
||||
@@ -8,21 +9,23 @@ namespace DMS.Infrastructure.Repositories;
|
||||
public class RepositoryManager : IRepositoryManager
|
||||
{
|
||||
private readonly SqlSugarClient _db;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly SqlSugarDbContext _dbContext;
|
||||
|
||||
public RepositoryManager(SqlSugarDbContext dbContext)
|
||||
public RepositoryManager(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
_dbContext = dbContext;
|
||||
_db = dbContext.GetInstance();
|
||||
|
||||
Devices = new DeviceRepository(dbContext);
|
||||
VariableTables = new VariableTableRepository(dbContext);
|
||||
Variables = new VariableRepository(dbContext);
|
||||
MqttServers = new MqttServerRepository(dbContext);
|
||||
VariableMqttAliases = new VariableMqttAliasRepository(dbContext);
|
||||
Menus = new MenuRepository(dbContext);
|
||||
VariableHistories = new VariableHistoryRepository(dbContext);
|
||||
Users = new UserRepository(dbContext);
|
||||
Devices = new DeviceRepository(mapper, dbContext);
|
||||
VariableTables = new VariableTableRepository(mapper, dbContext);
|
||||
Variables = new VariableRepository(mapper, dbContext);
|
||||
MqttServers = new MqttServerRepository(mapper, dbContext);
|
||||
VariableMqttAliases = new VariableMqttAliasRepository(mapper, dbContext);
|
||||
Menus = new MenuRepository(mapper, dbContext);
|
||||
VariableHistories = new VariableHistoryRepository(mapper, dbContext);
|
||||
Users = new UserRepository(mapper, dbContext);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
using System.Diagnostics;
|
||||
using DMS.Core.Interfaces;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Infrastructure.Data;
|
||||
using DMS.Infrastructure.Entities;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户仓储类,用于操作DbUser实体
|
||||
/// </summary>
|
||||
using AutoMapper;
|
||||
using DMS.Core.Helper;
|
||||
using DMS.Core.Interfaces;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
@@ -11,18 +24,44 @@ namespace DMS.Infrastructure.Repositories;
|
||||
/// </summary>
|
||||
public class UserRepository : BaseRepository<DbUser>, IUserRepository
|
||||
{
|
||||
public UserRepository(SqlSugarDbContext dbContext)
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public UserRepository(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public async Task<User> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<User> GetByIdAsync(int id)
|
||||
{
|
||||
var dbUser = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<User>(dbUser);
|
||||
}
|
||||
|
||||
public async Task<List<User>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<User>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<User>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<User> AddAsync(User entity) => throw new NotImplementedException();
|
||||
public async Task<User> AddAsync(User entity)
|
||||
{
|
||||
var dbUser = await base.AddAsync(_mapper.Map<DbUser>(entity));
|
||||
return _mapper.Map(dbUser, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(User entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(User entity) => await base.UpdateAsync(_mapper.Map<DbUser>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(User entity) => throw new NotImplementedException();
|
||||
public async Task<int> DeleteAsync(User entity) => await base.DeleteAsync(_mapper.Map<DbUser>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new User() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,12 @@
|
||||
using System.Diagnostics;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Infrastructure.Data;
|
||||
using DMS.Infrastructure.Entities;
|
||||
|
||||
|
||||
using AutoMapper;
|
||||
using DMS.Core.Helper;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Infrastructure.Data;
|
||||
@@ -7,18 +16,44 @@ namespace DMS.Infrastructure.Repositories;
|
||||
|
||||
public class VariableHistoryRepository : BaseRepository<DbVariableHistory>, IVariableHistoryRepository
|
||||
{
|
||||
public VariableHistoryRepository(SqlSugarDbContext dbContext)
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public VariableHistoryRepository(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public async Task<VariableHistory> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<VariableHistory> GetByIdAsync(int id)
|
||||
{
|
||||
var dbVariableHistory = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<VariableHistory>(dbVariableHistory);
|
||||
}
|
||||
|
||||
public async Task<List<VariableHistory>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<VariableHistory>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<VariableHistory>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<VariableHistory> AddAsync(VariableHistory entity) => throw new NotImplementedException();
|
||||
public async Task<VariableHistory> AddAsync(VariableHistory entity)
|
||||
{
|
||||
var dbVariableHistory = await base.AddAsync(_mapper.Map<DbVariableHistory>(entity));
|
||||
return _mapper.Map(dbVariableHistory, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(VariableHistory entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(VariableHistory entity) => await base.UpdateAsync(_mapper.Map<DbVariableHistory>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(VariableHistory entity) => throw new NotImplementedException();
|
||||
public async Task<int> DeleteAsync(VariableHistory entity) => await base.DeleteAsync(_mapper.Map<DbVariableHistory>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new Variable() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,19 @@
|
||||
using System.Diagnostics;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Infrastructure.Data;
|
||||
using DMS.Infrastructure.Entities;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 变量与MQTT服务器别名关联的数据仓库。
|
||||
/// </summary>
|
||||
using AutoMapper;
|
||||
using DMS.Core.Helper;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Infrastructure.Data;
|
||||
using DMS.Infrastructure.Entities;
|
||||
|
||||
namespace DMS.Infrastructure.Repositories;
|
||||
|
||||
/// <summary>
|
||||
@@ -9,18 +21,44 @@ namespace DMS.Infrastructure.Repositories;
|
||||
/// </summary>
|
||||
public class VariableMqttAliasRepository : BaseRepository<DbVariableMqttAlias>, IVariableMqttAliasRepository
|
||||
{
|
||||
public VariableMqttAliasRepository(SqlSugarDbContext dbContext)
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public VariableMqttAliasRepository(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public async Task<VariableMqttAlias> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<VariableMqttAlias> GetByIdAsync(int id)
|
||||
{
|
||||
var dbVariableMqttAlias = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<VariableMqttAlias>(dbVariableMqttAlias);
|
||||
}
|
||||
|
||||
public async Task<List<VariableMqttAlias>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<VariableMqttAlias>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<VariableMqttAlias>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<VariableMqttAlias> AddAsync(VariableMqttAlias entity) => throw new NotImplementedException();
|
||||
public async Task<VariableMqttAlias> AddAsync(VariableMqttAlias entity)
|
||||
{
|
||||
var dbVariableMqttAlias = await base.AddAsync(_mapper.Map<DbVariableMqttAlias>(entity));
|
||||
return _mapper.Map(dbVariableMqttAlias, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(VariableMqttAlias entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(VariableMqttAlias entity) => await base.UpdateAsync(_mapper.Map<DbVariableMqttAlias>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(VariableMqttAlias entity) => throw new NotImplementedException();
|
||||
public async Task<int> DeleteAsync(VariableMqttAlias entity) => await base.DeleteAsync(_mapper.Map<DbVariableMqttAlias>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new VariableMqttAlias() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -11,9 +13,12 @@ namespace DMS.Infrastructure.Repositories;
|
||||
/// </summary>
|
||||
public class VariableRepository : BaseRepository<DbVariable>, IVariableRepository
|
||||
{
|
||||
public VariableRepository(SqlSugarDbContext dbContext)
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public VariableRepository(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,13 +104,37 @@ public class VariableRepository : BaseRepository<DbVariable>, IVariableRepositor
|
||||
}
|
||||
}
|
||||
*/
|
||||
public async Task<Variable> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<Variable> GetByIdAsync(int id)
|
||||
{
|
||||
var dbVariable = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<Variable>(dbVariable);
|
||||
}
|
||||
|
||||
public async Task<List<Variable>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<Variable>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<Variable>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<Variable> AddAsync(Variable entity) => throw new NotImplementedException();
|
||||
public async Task<Variable> AddAsync(Variable entity)
|
||||
{
|
||||
var dbVariable = await base.AddAsync(_mapper.Map<DbVariable>(entity));
|
||||
return _mapper.Map(dbVariable, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(Variable entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(Variable entity) => await base.UpdateAsync(_mapper.Map<DbVariable>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(Variable entity) => throw new NotImplementedException();
|
||||
public async Task<int> DeleteAsync(Variable entity) => await base.DeleteAsync(_mapper.Map<DbVariable>(entity));
|
||||
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new Variable() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,12 @@
|
||||
using System.Diagnostics;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Infrastructure.Data;
|
||||
using DMS.Infrastructure.Entities;
|
||||
|
||||
|
||||
using AutoMapper;
|
||||
using DMS.Core.Helper;
|
||||
using DMS.Core.Interfaces.Repositories;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Infrastructure.Data;
|
||||
@@ -7,18 +16,44 @@ namespace DMS.Infrastructure.Repositories;
|
||||
|
||||
public class VariableTableRepository : BaseRepository<DbVariableTable>, IVariableTableRepository
|
||||
{
|
||||
public VariableTableRepository(SqlSugarDbContext dbContext)
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public VariableTableRepository(IMapper mapper, SqlSugarDbContext dbContext)
|
||||
: base(dbContext)
|
||||
{
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public async Task<VariableTable> GetByIdAsync(int id) => throw new NotImplementedException();
|
||||
public async Task<VariableTable> GetByIdAsync(int id)
|
||||
{
|
||||
var dbVariableTable = await base.GetByIdAsync(id);
|
||||
return _mapper.Map<VariableTable>(dbVariableTable);
|
||||
}
|
||||
|
||||
public async Task<List<VariableTable>> GetAllAsync() => throw new NotImplementedException();
|
||||
public async Task<List<VariableTable>> GetAllAsync()
|
||||
{
|
||||
var dbList = await base.GetAllAsync();
|
||||
return _mapper.Map<List<VariableTable>>(dbList);
|
||||
}
|
||||
|
||||
public async Task<VariableTable> AddAsync(VariableTable entity) => throw new NotImplementedException();
|
||||
public async Task<VariableTable> AddAsync(VariableTable entity)
|
||||
{
|
||||
var dbVariableTable = await base.AddAsync(_mapper.Map<DbVariableTable>(entity));
|
||||
return _mapper.Map(dbVariableTable, entity);
|
||||
}
|
||||
|
||||
public async Task<int> UpdateAsync(VariableTable entity) => throw new NotImplementedException();
|
||||
public async Task<int> UpdateAsync(VariableTable entity) => await base.UpdateAsync(_mapper.Map<DbVariableTable>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(VariableTable entity) => throw new NotImplementedException();
|
||||
public async Task<int> DeleteAsync(VariableTable entity) => await base.DeleteAsync(_mapper.Map<DbVariableTable>(entity));
|
||||
|
||||
public async Task<int> DeleteAsync(int id)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
var result = await Db.Deleteable(new VariableTable() { Id = id })
|
||||
.ExecuteCommandAsync();
|
||||
stopwatch.Stop();
|
||||
NlogHelper.Info($"Delete {typeof(DbMenu)},ID={id},耗时:{stopwatch.ElapsedMilliseconds}ms");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user