public async Task <ActionResult <CustomerViewModel> > Create([FromBody] CreateCustomerCommand command) { _logger.LogInformation( "----- Sending command: {CommandName}: {CommandId} ({@Command})", typeof(CreateCustomerCommand).Name, nameof(command.Name), command.Name, command); var customerId = await _mediator.Send(command); var customer = _queries.GetAsync(customerId); return(Created("", customer)); }
public Task <CustomerDto?> GetAsync(CustomerId id) { return(QueryAsync( Authorize.Unauthenticated, () => _customerQueries.GetAsync(id) )); }