public TodoListDTO Update(int id, TodoListDTO todoListDTO) { var todoList = _todoListService.Get(id); todoList.UpdateData(todoListDTO.Name, todoListDTO.Done, _categoryService.Get(todoListDTO.Category.Id)); return(_todoListMapper.MapperToDTO(_todoListService.Update(todoList))); }
public TaskDTO Add(TaskDTO taskDTO) { var task = _taskMapper.MapperToEntity(taskDTO); task.SetTodoList(_todoListService.Get(taskDTO.TodoList.Id)); task.SetUser(_userService.Get(taskDTO.User.Id)); return(_taskMapper.MapperToDTO(_taskService.Add(task))); }
public ActionResult <TodoListVm> GetById(int userId, int todoListId) { var todoList = _todoListService.Get(userId, todoListId); if (todoList == null) { return(NotFound()); } return(_mapper.Map <TodoListVm>(todoList)); }
public ActionResult <List <TodoItemVm> > GetAll(int userId, int todoListId) { var todoList = _todoListService.Get(userId, todoListId); if (todoList == null) { return(NotFound()); } return(_mapper.Map <List <TodoItemVm> >(todoList.TodoItems)); }
/// <summary> /// retrives collection of todo-lists /// </summary> /// <returns>collection of todo-lists</returns> public IHttpActionResult Get() { try { return(Ok(_todoListsService.Get())); } catch (Exception ex) { return(InternalServerError(ex)); } }
public ActionResult <ApiResult <TodoListItem> > GetById(Guid id) { var result = new ApiResult <TodoListItem>(); result.Data = _todoListService.Get(id); if (result.Data == null) { result.Message = "No Todo find with that Id"; return(NoContent()); } result.Message = "Todo Info"; return(result); }
public IEnumerable <TodoListItem> Get() { return(todoListService.Get()); }
public Task <IEnumerable <ToDoViewModel> > Get() { return(_todoListService.Get()); }