Migrations

This commit is contained in:
Kwoth
2016-10-08 04:35:39 +02:00
parent 895727d052
commit 2c3e975301
7 changed files with 813 additions and 11 deletions

View File

@@ -23,9 +23,9 @@ namespace NadekoBot.Modules.CustomReactions
{
using (var uow = DbHandler.UnitOfWork())
{
var list = uow.CustomReactions.GetList();
AllReactions = new ConcurrentDictionary<ulong, HashSet<CustomReaction>>(list.Where(g => g.GuildId != null).GroupBy(k => k.GuildId.Value).ToDictionary(g => g.Key, g => new HashSet<CustomReaction>(g)));
GlobalReactions = new HashSet<CustomReaction>(list.Where(g => g.GuildId == null));
var items = uow.CustomReactions.GetAll();
AllReactions = new ConcurrentDictionary<ulong, HashSet<CustomReaction>>(items.Where(g => g.GuildId != null).GroupBy(k => k.GuildId.Value).ToDictionary(g => g.Key, g => new HashSet<CustomReaction>(g)));
GlobalReactions = new HashSet<CustomReaction>(items.Where(g => g.GuildId == null));
}
}
public CustomReactions(ILocalization loc, CommandService cmds, ShardedDiscordClient client) : base(loc, cmds, client)