public IPaginate <ProductCategoryListModel.ListItem> Get(int index, int size, int from)
        {
            var productList = ProductCategoryListModel.Get(_productCategoryRepository);
            var page        = IPaginateExtension.ToPaginate <ProductCategoryListModel.ListItem>(productList.ProductCategories.ToList(), index, size, from);

            return(page);
        }
 public IActionResult ProductCategoryDetail(ProductCategoryDetailModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var productCategoryDetail = iProductCategory.GetProductCategoryDetail(DBHelper.ParseInt64(model.productCategoryId));
             if (productCategoryDetail != null)
             {
                 ProductCategoryListModel productCategoryListModel = ProductCategoryHelper.BindProductCategoryListModel(productCategoryDetail);
                 return(Ok(ResponseHelper.Success(productCategoryListModel)));
             }
             else
             {
                 return(Ok(ResponseHelper.Error(MessageConstants.DataNotFound)));
             }
         }
         else
         {
             return(Ok(ResponseHelper.Error(MessageConstants.CompulsoryData)));
         }
     }
     catch (Exception ex)
     {
         LogHelper.ExceptionLog(ex.Message + "  :::::  " + ex.StackTrace);
         return(Ok(ResponseHelper.Error(ex.Message)));
     }
 }
        /// <summary>
        /// Converts the product category list model.
        /// </summary>
        /// <param name="productCategoryModel">The model.</param>
        /// <returns></returns>
        public static ProductCategoryListModel BindProductCategoryListModel(ProductCategory productCategoryModel)
        {
            ProductCategoryListModel productCategoryListModel = new ProductCategoryListModel();

            if (productCategoryModel != null)
            {
                productCategoryListModel.Name = productCategoryModel.Name;
                productCategoryListModel.ProductCategoryId = productCategoryModel.ProductCategoryId;
            }
            return(productCategoryListModel);
        }
        public ProductCategoryListModel GetAll()
        {
            var productList = ProductCategoryListModel.Get(_productCategoryRepository);

            return(productList);
        }