Esempio n. 1
0
        public static Display.PricingEverydayValueDriver ToDisplayEntity(this DTO.PricingEverydayValueDriver dto)
        {
            var displayEntity = new Display.PricingEverydayValueDriver();

            displayEntity.Key        = dto.Key;
            displayEntity.Id         = dto.Id;
            displayEntity.Name       = dto.Name;
            displayEntity.Title      = dto.Title;
            displayEntity.Sort       = dto.Sort;
            displayEntity.IsSelected = dto.IsSelected;

            displayEntity.IsKey = dto.IsKey;

            foreach (var group in dto.Groups)
            {
                displayEntity.Groups.Add(group.ToDisplayEntity());
            }

            return(displayEntity);
        }
Esempio n. 2
0
        public static DTO.PricingEverydayValueDriver ToDto(this Display.PricingEverydayValueDriver displayEntity)
        {
            var groups = new List <DTO.PricingValueDriverGroup>();

            foreach (Display.PricingValueDriverGroup group in displayEntity.Groups)
            {
                groups.Add(group.ToDto());
            }

            var dto = new DTO.PricingEverydayValueDriver(
                displayEntity.Id,
                displayEntity.Key,
                displayEntity.IsSelected,
                displayEntity.Name,
                displayEntity.Title,
                displayEntity.Sort,
                displayEntity.IsKey,
                groups);

            return(dto);
        }