public async Task <Todo> CompleteAsync(TodoCompleteRequest request) { var todo = await _context.Todos.FindAsync(request.Id); todo.CompletedAt = _utcNowProvider.UtcNow(); _context.Update(todo); await _context.SaveChangesAsync(); return(todo); }
public async Task <TodoDTO> Complete([FromBody] TodoCompleteRequest request) { return(_mapper.Map <TodoDTO>(await _service.CompleteAsync(request))); }