コード例 #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);
        }
コード例 #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);
        }