Exemplo n.º 1
0
        public async Task <SolutionComment> AddSolutionComment(SolutionComment comment)
        {
            comment.DateAdded = DateTime.UtcNow;
            comment           = _dbContext.SolutionComments.Add(comment);
            await _dbContext.SaveChangesAsync();

            return(comment);
        }
Exemplo n.º 2
0
        public async Task Delete(Solution solution)
        {
            _dbContext.SolutionComments.RemoveRange(solution.SolutionComments);



            _dbContext.Solutions.Remove(solution);
            await _dbContext.SaveChangesAsync();
        }
Exemplo n.º 3
0
 public async Task Create(Problem problem)
 {
     problem.DateAdded = DateTime.UtcNow;
     _dbContext.Problems.Add(problem);
     await _dbContext.SaveChangesAsync();
 }
Exemplo n.º 4
0
 public async Task SaveChangesAsync()
 {
     await _dbContext.SaveChangesAsync();
 }
Exemplo n.º 5
0
 public async Task DeleteForItemId(int itemId)
 {
     _dbContext.Votes.RemoveRange(_dbContext.Votes.Where(m => m.ItemId == itemId).ToList());
     await _dbContext.SaveChangesAsync();
 }
Exemplo n.º 6
0
 public async Task Create(User user)
 {
     user.DateAdded = DateTime.UtcNow;
     _dbContext.Users.Add(user);
     await _dbContext.SaveChangesAsync();
 }