Exemplo n.º 1
0
        public async Task DeleteUser(int userId)
        {
            var _toDelete = _context.Query <Admin>()
                            .Where(x => x.UserId == userId)
                            .FirstOrDefault();

            _toDelete.Dormant = true;
            _context.Update(_toDelete);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 2
0
        public async Task DeleteVote(int voteId)
        {
            var _toDelete = _context.Query <Vote>()
                            .Where(x => x.VoteId == voteId)
                            .FirstOrDefault();

            _toDelete.Dormant = true;
            _context.Update(_toDelete);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 3
0
 public Candidate GetCandidate(int candidateId)
 {
     return(_context.Query <Candidate>()
            .Where(x => x.CandidateId == candidateId)
            .FirstOrDefault());
 }