Exemplo n.º 1
0
        public async Task <PollVote> AddPollVoteAsync(PollVote pv)
        {
            await _context.PollVote.AddAsync(pv);

            await _context.SaveChangesAsync();

            return(pv);
        }
Exemplo n.º 2
0
        public async Task <PollChoice> AddPollChoicesAsync(PollChoice pc)
        {
            await _context.PollChoices.AddAsync(pc);

            await _context.SaveChangesAsync();

            return(pc);
        }
Exemplo n.º 3
0
        public async Task <User> AddUserAsync(User user)
        {
            await _context.User.AddAsync(user);

            await _context.SaveChangesAsync();

            return(user);
        }
Exemplo n.º 4
0
        public async Task <Poll> AddPollAsync(Poll poll)
        {
            //string randomChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
            //string stringcode = "";
            //var random = new Random();

            //for (int i = 0; i < 6; i++)
            //{
            //    stringcode += randomChars[random.Next(randomChars.Length)];
            //}
            //poll.Code = stringcode;
            await _context.Poll.AddAsync(poll);

            await _context.SaveChangesAsync();

            return(poll);
        }