public static ResponseViewModel<PageViewModel<GetProductList_Result>> GetProductList(SearchViewModel searchViewModel)
 {
     using (EcommerceEntities entities = new EcommerceEntities())
     {
         ResponseViewModel<PageViewModel<GetProductList_Result>> ViewModel = new ResponseViewModel<PageViewModel<GetProductList_Result>>();
         List<GetProductList_Result> getProductResult = new List<GetProductList_Result>();
         PageViewModel<GetProductList_Result> pageViewModel = new PageViewModel<GetProductList_Result>();
         getProductResult = entities.GetProductList(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;
     }
 }