Ejemplo n.º 1
0
        public void Handle(CustomerMaritalStatusChanged evnt)
        {
            var customer = _dataBase.Get(evnt.CustomerId.ToString()) as CustomerDto;

            if (customer == null)
            {
                throw new DataException(string.Format("Can not find a customer with id '{0}'", evnt.CustomerId));
            }

            customer.MaritalStatus = evnt.MaritalStatus;
            _dataBase.Save(evnt.CustomerId.ToString(), customer);
        }
Ejemplo n.º 2
0
        public void Handle(CustomerMovedToNewAddress evnt)
        {
            var customer = (CustomerDto)_dataBase.Get(evnt.CustomerId.ToString());

            customer.Address = new AddressDto
            {
                City           = evnt.City,
                HouseNumber    = evnt.HouseNumber,
                PrimaryAddress = true,
                State          = evnt.State,
                Street         = evnt.Street,
                Zip            = evnt.Zip,
            };
            _dataBase.Save(evnt.CustomerId.ToString(), customer);
        }