public static RefinementGroup ConvertToRefinementGroup(this IEnumerable<IProductAttribute> productAttributes, RefinementGroupings refinementGroupType)
        {
            RefinementGroup refinementGroup = new RefinementGroup() { Name = refinementGroupType.ToString(), GroupId = (int)refinementGroupType };

            refinementGroup.Refinements = Mapper.Map<IEnumerable<IProductAttribute>, IEnumerable<Refinement>>(productAttributes);

            return refinementGroup;
        }
        public static RefinementGroup ConvertToRefinementGroup(this IEnumerable <IProductAttribute> productAttributes, RefinementGroupings refinementGroupType)
        {
            RefinementGroup refinementGroup = new RefinementGroup()
            {
                Name = refinementGroupType.ToString(), GroupId = (int)refinementGroupType
            };

            refinementGroup.Refinements = Mapper.Map <IEnumerable <IProductAttribute>, IEnumerable <Refinement> >(productAttributes);

            return(refinementGroup);
        }
        public static RefinementGroup ConvertToRefinementGroup(
                                this IEnumerable<IProductAttribute> productAttributes,
                                RefinementGroupings refinementGroupType)
        {
            RefinementGroup refinementGroup = new RefinementGroup()
            {
                Name = refinementGroupType.ToString(),
                GroupId = (int)refinementGroupType
            };

            refinementGroup.Refinements = from p in productAttributes
                                          select new Refinement
                                          {
                                              Id = p.Id,
                                              Name = p.Name
                                          };
            return refinementGroup;
        }
        public static RefinementGroup ConvertToRefinementGroup(
            this IEnumerable <IProductAttribute> productAttributes,
            RefinementGroupings refinementGroupType)
        {
            RefinementGroup refinementGroup = new RefinementGroup()
            {
                Name    = refinementGroupType.ToString(),
                GroupId = (int)refinementGroupType
            };

            refinementGroup.Refinements = from p in productAttributes
                                          select new Refinement
            {
                Id   = p.Id,
                Name = p.Name
            };
            return(refinementGroup);
        }
Beispiel #5
0
        public static RefinementGroup ConvertToRefinementGroup(
            this IEnumerable <IPseudoSkuAttribute> pseudoSkuAttributes,
            RefinementGroupings refinementGroupType)
        {
            RefinementGroup refinementGroup = new RefinementGroup()
            {
                Name    = refinementGroupType.ToString(),
                GroupId = (int)refinementGroupType
            };

            foreach (var refinement in refinementGroup.Refinements)
            {
                foreach (var pseudoSkuAttribute in pseudoSkuAttributes)
                {
                    pseudoSkuAttribute.Id   = refinement.Id;
                    pseudoSkuAttribute.Name = refinement.Name;
                }
            }

            return(refinementGroup);
        }