public TodoListDto SaveNewTodoList([FromBody] TodoListDto dto)
        {
            TodoList newTodoList   = todoListMapper.MapToObject(dto);
            TodoList savedTodoList = todoListRepository.SaveNew(newTodoList);

            return(todoListMapper.MapToDto(savedTodoList));
        }
예제 #2
0
        public TodoListDto MapToDto(TodoList obj)
        {
            TodoListDto dto = new TodoListDto();

            dto.id          = obj.GetId();
            dto.name        = obj.GetName();
            dto.description = obj.GetDescription();

            return(dto);
        }
예제 #3
0
        public TodoList MapToObject(TodoListDto dto)
        {
            TodoList obj = new TodoList(
                dto.id,
                dto.name,
                dto.description
                );

            return(obj);
        }
        public void UpdateTodoListById(int id, [FromBody] TodoListDto dto)
        {
            TodoList todoList = todoListMapper.MapToObject(dto);

            todoListRepository.Update(todoList);
        }