Esempio n. 1
0
        public async void AddToPoll(VoteContext context, Account[] ToAdd, Poll poll)
        {
            try
            {
                for (int i = 0; i < ToAdd.Length; i++)
                {
                    PollAccount pa = new PollAccount()
                    {
                        Account = ToAdd[i],
                        Poll    = poll
                    };

                    context.PollAccounts.Add(pa);
                }

                await context.SaveChangesAsync();
            }
            catch (DbUpdateException e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 2
0
 public async void AddAnonPoll(VoteContext context, AnonPoll[] anonpolls)
 {
     context.AnonPolls.AddRange(anonpolls);
     await context.SaveChangesAsync();
 }
Esempio n. 3
0
 public async void AddPoll(VoteContext context, Poll[] polls)
 {
     context.Polls.AddRange(polls);
     await context.SaveChangesAsync();
 }
Esempio n. 4
0
 public async void AddAccount(VoteContext context, Account[] accounts)
 {
     context.Accounts.AddRange(accounts);
     await context.SaveChangesAsync();
 }
Esempio n. 5
0
 public async void AddPoll(VoteContext context, Poll poll)
 {
     context.Polls.Add(poll);
     await context.SaveChangesAsync();
 }