/// <inheritdoc /> public override async Task HandleAsync(DeactiveCustomerIntegrationEvent @event) { var command = new DeactiveCustomerCommand { CustomerId = @event.CustomerId }; await _bus.SendAsync(command); }
public async Task <IActionResult> DeactiveCustomerAsync(Guid customerId) { var command = new DeactiveCustomerCommand { CustomerId = customerId }; await SendCommandAsync(command); return(Ok()); }
private static void _deactiveCustomer(Guid cust1Id, ICommandDispatcher <Customer> dispatcher) { // Get the command from the API (AMQP/REST..) var commandId = Guid.NewGuid(); // CLIENT genrated command id. var dateCreated = DateTime.Now; // Date/Time the client created the command var issuedBy = "*****@*****.**"; // Identity, like username of user who issued the command var command = new DeactiveCustomerCommand(commandId, dateCreated, cust1Id, issuedBy); // Dispatch the command dispatcher.Dispatch(command); }