Exemple #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);
            }
        }
Exemple #2
0
 public async void AddAnonPoll(VoteContext context, AnonPoll[] anonpolls)
 {
     context.AnonPolls.AddRange(anonpolls);
     await context.SaveChangesAsync();
 }
Exemple #3
0
 public async void AddPoll(VoteContext context, Poll[] polls)
 {
     context.Polls.AddRange(polls);
     await context.SaveChangesAsync();
 }
Exemple #4
0
 public async void AddAccount(VoteContext context, Account[] accounts)
 {
     context.Accounts.AddRange(accounts);
     await context.SaveChangesAsync();
 }
Exemple #5
0
 public async void AddPoll(VoteContext context, Poll poll)
 {
     context.Polls.Add(poll);
     await context.SaveChangesAsync();
 }