/// <summary>
        /// Prepare paged predefined product attribute value list model
        /// </summary>
        /// <param name="searchModel">Predefined product attribute value search model</param>
        /// <param name="productAttribute">Product attribute</param>
        /// <returns>Predefined product attribute value list model</returns>
        public virtual async Task <PredefinedProductAttributeValueListModel> PreparePredefinedProductAttributeValueListModelAsync(
            PredefinedProductAttributeValueSearchModel searchModel, ProductAttribute productAttribute)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            if (productAttribute == null)
            {
                throw new ArgumentNullException(nameof(productAttribute));
            }

            //get predefined product attribute values
            var values = (await _productAttributeService.GetPredefinedProductAttributeValuesAsync(productAttribute.Id)).ToPagedList(searchModel);

            //prepare list model
            var model = new PredefinedProductAttributeValueListModel().PrepareToGrid(searchModel, values, () =>
            {
                return(values.Select(value =>
                {
                    //fill in model values from the entity
                    var predefinedProductAttributeValueModel = value.ToModel <PredefinedProductAttributeValueModel>();

                    //fill in additional values (not existing in the entity)
                    predefinedProductAttributeValueModel.WeightAdjustmentStr = value.WeightAdjustment.ToString("G29");
                    predefinedProductAttributeValueModel.PriceAdjustmentStr = value.PriceAdjustment
                                                                              .ToString("G29") + (value.PriceAdjustmentUsePercentage ? " %" : string.Empty);

                    return predefinedProductAttributeValueModel;
                }));
            });

            return(model);
        }
        /// <summary>
        /// Prepare paged predefined product attribute value list model
        /// </summary>
        /// <param name="searchModel">Predefined product attribute value search model</param>
        /// <param name="productAttribute">Product attribute</param>
        /// <returns>Predefined product attribute value list model</returns>
        public virtual PredefinedProductAttributeValueListModel PreparePredefinedProductAttributeValueListModel(
            PredefinedProductAttributeValueSearchModel searchModel, ProductAttribute productAttribute)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            if (productAttribute == null)
            {
                throw new ArgumentNullException(nameof(productAttribute));
            }

            //get predefined product attribute values
            var values = _productAttributeService.GetPredefinedProductAttributeValues(productAttribute.Id);

            //prepare list model
            var model = new PredefinedProductAttributeValueListModel
            {
                Data = values.PaginationByRequestModel(searchModel).Select(value =>
                {
                    //fill in model values from the entity
                    var predefinedProductAttributeValueModel = new PredefinedProductAttributeValueModel
                    {
                        Id = value.Id,
                        ProductAttributeId = value.ProductAttributeId,
                        Name          = value.Name,
                        IsPreSelected = value.IsPreSelected,
                        DisplayOrder  = value.DisplayOrder
                    };

                    //fill in additional values (not existing in the entity)
                    predefinedProductAttributeValueModel.WeightAdjustmentStr = value.WeightAdjustment.ToString("G29");
                    predefinedProductAttributeValueModel.PriceAdjustmentStr  = value.PriceAdjustment
                                                                               .ToString("G29") + (value.PriceAdjustmentUsePercentage ? " %" : string.Empty);

                    return(predefinedProductAttributeValueModel);
                }),
                Total = values.Count
            };

            return(model);
        }