mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	Removed poll repository
This commit is contained in:
		@@ -3,6 +3,7 @@ using Discord;
 | 
			
		||||
using NadekoBot.Core.Services.Database.Models;
 | 
			
		||||
using NadekoBot.Core.Services;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Threading;
 | 
			
		||||
 | 
			
		||||
namespace NadekoBot.Modules.Games.Common
 | 
			
		||||
@@ -57,7 +58,7 @@ namespace NadekoBot.Modules.Games.Common
 | 
			
		||||
            finally { _locker.Release(); }
 | 
			
		||||
            using (var uow = _db.GetDbContext())
 | 
			
		||||
            {
 | 
			
		||||
                var trackedPoll = uow.Polls.GetById(Poll.Id);
 | 
			
		||||
                var trackedPoll = uow._context.Poll.FirstOrDefault(x => x.Id == Poll.Id);
 | 
			
		||||
                trackedPoll.Votes.Add(voteObj);
 | 
			
		||||
                uow.SaveChanges();
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ namespace NadekoBot.Modules.Games.Services
 | 
			
		||||
 | 
			
		||||
            using (var uow = db.GetDbContext())
 | 
			
		||||
            {
 | 
			
		||||
                ActivePolls = uow.Polls.GetAllPolls()
 | 
			
		||||
                ActivePolls = uow._context.Poll.GetAllPolls()
 | 
			
		||||
                    .ToDictionary(x => x.GuildId, x =>
 | 
			
		||||
                    {
 | 
			
		||||
                        var pr = new PollRunner(db, x);
 | 
			
		||||
@@ -70,7 +70,7 @@ namespace NadekoBot.Modules.Games.Services
 | 
			
		||||
            {
 | 
			
		||||
                using (var uow = _db.GetDbContext())
 | 
			
		||||
                {
 | 
			
		||||
                    uow.Polls.Add(p);
 | 
			
		||||
                    uow._context.Poll.Add(p);
 | 
			
		||||
                    uow.SaveChanges();
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
@@ -87,7 +87,7 @@ namespace NadekoBot.Modules.Games.Services
 | 
			
		||||
                pr.OnVoted -= Pr_OnVoted;
 | 
			
		||||
                
 | 
			
		||||
                using var uow = _db.GetDbContext();
 | 
			
		||||
                uow.Polls.RemovePoll(pr.Poll.Id);
 | 
			
		||||
                uow._context.RemovePoll(pr.Poll.Id);
 | 
			
		||||
                uow.SaveChanges();
 | 
			
		||||
                
 | 
			
		||||
                return pr.Poll;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user