public async Task <SolutionComment> AddSolutionComment(SolutionComment comment) { comment.DateAdded = DateTime.UtcNow; comment = _dbContext.SolutionComments.Add(comment); await _dbContext.SaveChangesAsync(); return(comment); }
public async Task Delete(Solution solution) { _dbContext.SolutionComments.RemoveRange(solution.SolutionComments); _dbContext.Solutions.Remove(solution); await _dbContext.SaveChangesAsync(); }
public async Task Create(Problem problem) { problem.DateAdded = DateTime.UtcNow; _dbContext.Problems.Add(problem); await _dbContext.SaveChangesAsync(); }
public async Task SaveChangesAsync() { await _dbContext.SaveChangesAsync(); }
public async Task DeleteForItemId(int itemId) { _dbContext.Votes.RemoveRange(_dbContext.Votes.Where(m => m.ItemId == itemId).ToList()); await _dbContext.SaveChangesAsync(); }
public async Task Create(User user) { user.DateAdded = DateTime.UtcNow; _dbContext.Users.Add(user); await _dbContext.SaveChangesAsync(); }