コード例 #1
0
 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;
 }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 private void InvokeCustomerUpdateEvent()
 {
     CustomerUpdateEvent?.Invoke(new Object(), EventArgs.Empty);
 }