public async Task ListenForCustomerCreatedEvent(CustomerCreatedEvent createdEvent) { await _repo.AddCustomer(createdEvent.ToCustomerModel()); await _eventSender.SendEventsToQueue(createdEvent); //return createdEvent.ToCustomerModel(); }
public async Task <Customer> ListenForCustomerCreatedEvent(CustomerCreatedEvent createdEvent) { var cust = createdEvent.ToCustomerModel(); var result = await this.repo.AddCustomer(cust); createdEvent.Id = result.Id; cust.Id = result.Id; await eventSender.SendEventsToQueue(createdEvent); return(cust); }