public TodoListDto SaveNewTodoList([FromBody] TodoListDto dto) { TodoList newTodoList = todoListMapper.MapToObject(dto); TodoList savedTodoList = todoListRepository.SaveNew(newTodoList); return(todoListMapper.MapToDto(savedTodoList)); }
public TodoListDto MapToDto(TodoList obj) { TodoListDto dto = new TodoListDto(); dto.id = obj.GetId(); dto.name = obj.GetName(); dto.description = obj.GetDescription(); return(dto); }
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); }