Exemplo n.º 1
0
        public static IEnumerable <ChangeItem> GetChangeItems(CustomerDTO dto, Customer customer)
        {
            IEnumerable <ChangeItem> changeItems = from c in dto.Changes
                                                   select
                                                   new ChangeItem(c.ChangeType,
                                                                  AddressAdapter.DtoToAddress((AddressDTO)c.Object));

            return(changeItems);
        }
Exemplo n.º 2
0
        public static CustomerDTO CustomerToDto(Customer c)
        {
            CustomerDTO dto = new CustomerDTO()
            {
                Id        = c.CustomerId,
                Name      = c.Name,
                FirstName = c.FirstName,
                Version   = c.Version,
                Addresses = AddressAdapter.AddressToDtos(c.Addresses)
            };

            return(dto);
        }