public static DTO.PricingEverydayLinkedValueDriver ToDto(this Display.PricingEverydayLinkedValueDriver displayEntity) { var groups = new List <DTO.PricingEverydayLinkedValueDriverGroup>(); foreach (Display.PricingEverydayLinkedValueDriverGroup group in displayEntity.Groups) { groups.Add(group.ToDto()); } var dto = new DTO.PricingEverydayLinkedValueDriver(displayEntity.ValueDriverId, groups); return(dto); }
public static Display.PricingEverydayLinkedValueDriver ToDisplayEntity(this DTO.PricingEverydayLinkedValueDriver dto) { var displayEntity = new Display.PricingEverydayLinkedValueDriver(); displayEntity.ValueDriverId = dto.ValueDriverId; foreach (DTO.PricingEverydayLinkedValueDriverGroup group in dto.Groups) { displayEntity.Groups.Add(group.ToDisplayEntity()); } return(displayEntity); }