public async Task <IActionResult> SetPrimaryAddress(Guid customerId, Guid addressId) { var command = new SetPrimaryAddressCommand(customerId, addressId); await _messaging.SendAsync(command); return(Ok()); }
public async Task OnSetPrimary(SetPrimaryAddressCommand command) { Customer customer = await _customerRepo.ReadAsync(command.CustomerId); customer.SetPrimaryAddressTo(command.AddressId); }