private void OnUpdateCustomer(CustomerUpdateEvent @event) { Id = @event.Id; CompanyName = @event.CompanyName; ContactName = @event.ContactName; ContactTitle = @event.ContactTitle; Email = @event.Email; Address = @event.Address; City = @event.City; PostalCode = @event.PostalCode; Country = @event.Country; Phone = @event.Phone; }
public CustomerViewModel CreateViewModel(object @event) { switch (@event) { case CustomerAddEvent x: CustomerAddEvent customerAddEvent = @event as CustomerAddEvent; return(_mapper.Map <CustomerViewModel>(customerAddEvent)); case CustomerUpdateEvent x: CustomerUpdateEvent customerUpdateEvent = @event as CustomerUpdateEvent; return(_mapper.Map <CustomerViewModel>(customerUpdateEvent)); case CustomerRemoveEvent x: CustomerRemoveEvent customerRemoveEvent = @event as CustomerRemoveEvent; return(_mapper.Map <CustomerViewModel>(customerRemoveEvent)); default: return(null); } }
private void InvokeCustomerUpdateEvent() { CustomerUpdateEvent?.Invoke(new Object(), EventArgs.Empty); }