public async Task <ActionResult <TodoModel> > GetTodo(int id) { var todo = await _todosRepository.GetTodoAsync(id); if (todo == null) { return(NotFound()); } return(_mapper.Map <TodoModel>(todo)); }
public async Task <TodoRecord?> GetTodoByIdAsync(int id) { var entity = await _todosRepository.GetTodoAsync(id); return(entity is null ? null : new TodoRecord(entity.Id, entity.Title, entity.Description, entity.IsComplete)); }
public Task <TodoItem> GetTodoAsync(int id) { return(_todosRepository.GetTodoAsync(id)); }