public async Task <PollVote> AddPollVoteAsync(PollVote pv) { await _context.PollVote.AddAsync(pv); await _context.SaveChangesAsync(); return(pv); }
public async Task <PollChoice> AddPollChoicesAsync(PollChoice pc) { await _context.PollChoices.AddAsync(pc); await _context.SaveChangesAsync(); return(pc); }
public async Task <User> AddUserAsync(User user) { await _context.User.AddAsync(user); await _context.SaveChangesAsync(); return(user); }
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); }