mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 18:28:27 -04:00
UnitOfWork compltely removed. GetDbContext now returns a NadekoContext. Changed every access to contect via uow._context to uow
This commit is contained in:
@@ -48,12 +48,12 @@ namespace NadekoBot.Modules.Permissions
|
||||
var name = command.Name.ToLowerInvariant();
|
||||
using (var uow = _db.GetDbContext())
|
||||
{
|
||||
var config = uow._context.GuildConfigsForId(channel.Guild.Id, set => set.Include(gc => gc.CommandCooldowns));
|
||||
var config = uow.GuildConfigsForId(channel.Guild.Id, set => set.Include(gc => gc.CommandCooldowns));
|
||||
var localSet = CommandCooldowns.GetOrAdd(channel.Guild.Id, new ConcurrentHashSet<CommandCooldown>());
|
||||
|
||||
var toDelete = config.CommandCooldowns.FirstOrDefault(cc => cc.CommandName == name);
|
||||
if (toDelete != null)
|
||||
uow._context.Set<CommandCooldown>().Remove(toDelete);
|
||||
uow.Set<CommandCooldown>().Remove(toDelete);
|
||||
localSet.RemoveWhere(cc => cc.CommandName == name);
|
||||
if (secs != 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user