public static Store ReadFromDTO(Store target, StoreDTO source) { SalesPersonTX.ReadFromDTO(target.SalesPerson, source.SalesPerson); target.SalesPersonId = source.SalesPersonId; target.StoreName = source.StoreName; target.EntityId = source.EntityId; ReadAddressesFromDTO(target.Entity.Addresses, source.Addresses); ReadContactDetailsFromDTO(target.Entity.ContactDetails, source.ContactDetails); target.ModifiedDate = source.ModifiedDate; return(target); }
public static StoreDTO WriteToDTO(Store source) { return(new StoreDTO { SalesPerson = SalesPersonTX.WriteToDTO(source.SalesPerson), SalesPersonId = source.SalesPersonId, StoreName = source.StoreName, EntityId = source.EntityId, Addresses = source.Entity.Addresses.Select(EntityAddressTX.WriteToDTO).ToArray(), ContactDetails = source.Entity.ContactDetails.Select(EntityContactTX.WriteToDTO).ToArray(), ModifiedDate = source.ModifiedDate, }); }