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); }
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); }