Esempio n. 1
0
        public async Task <ActionResult <TodoModel> > GetTodo(int id)
        {
            var todo = await _todosRepository.GetTodoAsync(id);

            if (todo == null)
            {
                return(NotFound());
            }

            return(_mapper.Map <TodoModel>(todo));
        }
Esempio n. 2
0
        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));
 }