public async Task Handle(CreatePoemForPersonEventContext @event) { var createPoem = new CreatePoemContext(@event.PersonId); await commandBuilder.ExecuteAsync(createPoem); var estimatePoem = new EstimatePoemContext(createPoem.IdAfterCreate); await commandBuilder.ExecuteAsync(estimatePoem); }
public async Task <IActionResult> CreatePoemForPerson(long personId) { var createPoem = new CreatePoemContext(personId); await commandBuilder.ExecuteAsync(createPoem); var estimatePoem = new EstimatePoemContext(createPoem.IdAfterCreate); await commandBuilder.ExecuteAsync(estimatePoem); return(Ok()); }