예제 #1
0
        public async Task <PollVote> UpdatePollVoteAsync(PollVote pv)
        {
            PollVote oldpv = await _context.PollVote.FindAsync(pv.ID);

            _context.Entry(oldpv).CurrentValues.SetValues(pv);
            await _context.SaveChangesAsync();

            _context.ChangeTracker.Clear();
            return(pv);
        }
예제 #2
0
        public async Task <PollChoice> UpdatePollChoicesAsync(PollChoice pc)
        {
            PollChoice oldpc = await _context.PollChoices.FindAsync(pc.ID);

            _context.Entry(oldpc).CurrentValues.SetValues(pc);
            await _context.SaveChangesAsync();

            _context.ChangeTracker.Clear();
            return(pc);
        }
예제 #3
0
        public async Task <Poll> UpdatePollAsync(Poll poll)
        {
            Poll oldpoll = await _context.Poll.FindAsync(poll.ID);

            _context.Entry(oldpoll).CurrentValues.SetValues(poll);
            await _context.SaveChangesAsync();

            _context.ChangeTracker.Clear();
            return(poll);
        }
예제 #4
0
파일: UserRepoDB.cs 프로젝트: hmittig/VotEZ
        public async Task <User> UpdateUserAsync(User user)
        {
            User oldUser = await _context.User.Where(u => u.ID == user.ID).FirstOrDefaultAsync();

            _context.Entry(oldUser).CurrentValues.SetValues(user);

            await _context.SaveChangesAsync();

            _context.ChangeTracker.Clear();
            return(user);
        }