public ActionResult _PropertyRent(PropertyRentSearchModel searchModel) { PropertiesViewModel model = new PropertiesViewModel(); try { model.SearchModel = _rent.SearchRentProperty(searchModel); if (model.SearchModel.Count > 0) { model.pager = new Pager(model.SearchModel.FirstOrDefault().TotalRows, searchModel.PageNumber, searchModel.PageSize); } else { model.pager = new Pager(2, searchModel.PageNumber); } } catch (Exception e) { } return(View(model)); }