public void AddTask(Task task) { using (ctx) { ctx.Tasks.Add(task); ctx.SaveChanges(); } }
public async Task <TaskDTO> GetTask(int taskId) { ApplicationTask entity = await _taskRepository.Get(taskId); if (entity == null) { throw new NotFoundException(typeof(ApplicationTask), taskId); } var dto = _mapper.Map <TaskDTO>(entity); return(dto); }