예제 #1
0
        public async Task <int> RemoveUserFromTeam(User user)
        {
            user.TeamId = null;
            _dbLogService.LogOnEntityDelete(user);

            return(await _context.SaveChangesAsync());
        }
예제 #2
0
        public async Task <int> RemoveUserFromTaskAsync(Tasks task, TaskStatus status)
        {
            task.UserId = null;
            task.Status = status;
            _dbLogService.LogOnEntityDelete(task);

            return(await _context.SaveChangesAsync());
        }
예제 #3
0
        public async Task <int> RemoveCommentAsync(int commentId)
        {
            var commentToRemove = await _context.Comments
                                  .SingleOrDefaultAsync(c => c.Id == commentId);

            _dbLogService.LogOnEntityDelete(commentToRemove);

            _context.Comments.Remove(commentToRemove);
            return(await _context.SaveChangesAsync());
        }