public Task <ICommandResult> Handle(UpdatePersonCommand command, CancellationToken token) { // Pretend we have a database var person = GetPersonFromDb(command.Id); if (person == null) { return(Task.FromResult(_resultFactory.NotFound())); } person.FirstName = command.FirstName; person.LastName = command.LastName; // We should save this back... return(Task.FromResult(_resultFactory.Ok(person))); }
public ICommandResult Handle(UpdatePersonCommand command) { // Pretend we have a database var person = GetPersonFromDb(command.Id); if (person == null) { return(_resultFactory.NotFound()); } person.FirstName = command.FirstName; person.LastName = command.LastName; // We should save this back... return(_resultFactory.Ok(person)); }