public TodoListDTO Add(TodoListDTO todoListDTO) { var todoList = _todoListMapper.MapperToEntity(todoListDTO); todoList.SetCategory(_categoryService.Get(todoList.Category.Id)); return(_todoListMapper.MapperToDTO(_todoListService.Add(todoList))); }
public TaskDTO MapperToDTO(Task task) => task != null ? new TaskDTO(task.Id, task.Name, task.Done, _todoListMapper.MapperToDTO(task.TodoList), _userMapper.MapperToDTO(task.User)) : null;