Exemple #1
0
        public static DTO.ModuleFeature ToDto(this Display.ModuleFeature displayEntity)
        {
            var featureSteps = new List <DTO.ModuleFeatureStep>();

            foreach (var step in displayEntity.Steps)
            {
                featureSteps.Add(step.ToDto());
            }

            var searchGroups = new List <DTO.FeatureSearchGroup>();

            foreach (var searchGroup in displayEntity.SearchGroups)
            {
                searchGroups.Add(searchGroup.ToDto());
            }

            var result = new DTO.ModuleFeature(
                displayEntity.Name,
                displayEntity.Title,
                displayEntity.Sort,
                displayEntity.Type,
                displayEntity.LandingStepType,
                displayEntity.ActionStepType,
                featureSteps,
                searchGroups);

            return(result);
        }
Exemple #2
0
        public static Display.ModuleFeature ToDisplayEntity(this DTO.ModuleFeature dto)
        {
            var result = new Display.ModuleFeature();

            result.Type            = dto.Type;
            result.Name            = dto.Name;
            result.Title           = dto.Title;
            result.Sort            = dto.Sort;
            result.LandingStepType = dto.LandingStepType;
            result.ActionStepType  = dto.ActionStepType;

            if (dto.SearchGroups != null)
            {
                foreach (DTO.FeatureSearchGroup searchGroup in dto.SearchGroups)
                {
                    result.SearchGroups.Add(searchGroup.ToDisplayEntity());
                }
            }

            if (dto.Steps != null)
            {
                foreach (DTO.ModuleFeatureStep step in dto.Steps)
                {
                    result.Steps.Add(step.ToDisplayEntity());
                }
            }

            return(result);
        }