public static ResponseViewModel <PageViewModel <GetSubCategoryList_Result> > GetProductCategoryList(SearchViewModel searchViewModel)
 {
     using (EcommerceEntities entities = new EcommerceEntities())
     {
         ResponseViewModel <PageViewModel <GetSubCategoryList_Result> > ViewModel = new ResponseViewModel <PageViewModel <GetSubCategoryList_Result> >();
         List <GetSubCategoryList_Result>          getProductResult = new List <GetSubCategoryList_Result>();
         PageViewModel <GetSubCategoryList_Result> pageViewModel    = new PageViewModel <GetSubCategoryList_Result>();
         getProductResult           = entities.GetSubCategoryList(searchViewModel.pageIndex, searchViewModel.pageSize, searchViewModel.searchText == "" ? null : searchViewModel.searchText, searchViewModel.sortOrder, searchViewModel.sortColoumn).ToList();
         pageViewModel.Data         = getProductResult;
         pageViewModel.totalRecords = getProductResult.Count();
         if (((pageViewModel.totalRecords % searchViewModel.pageSize) == 0))
         {
             if (pageViewModel.totalRecords < searchViewModel.pageSize)
             {
                 pageViewModel.totalPage = 1;
             }
             else
             {
                 pageViewModel.totalPage = (pageViewModel.totalRecords / searchViewModel.pageSize);
             }
         }
         else
         {
             pageViewModel.totalPage = (pageViewModel.totalRecords / 10) + 1;
         }
         ViewModel.Data = pageViewModel;
         return(ViewModel);
     }
 }