// GET: Home
        public ActionResult Index(int? page)
        {

            int pageNumber = (page ?? 1);
            int pageCount = lotService.Count() / pageSize;
            var lots = Mapper.Map<IEnumerable<LotViewModel>>(lotService.GetSomeLots(pageSize, (pageNumber - 1) * pageSize));           
            var viewModel = new IndexViewModel()
            {
                PageCount = pageCount,
                Page = pageNumber,
                Lots = lots,
                Categories = new List<Category>()
            };
            return View(viewModel);
        }
 public ActionResult Search (string search,int? page)
 {
     if (!string.IsNullOrWhiteSpace(search))
     {
         
         int pageNumber = (page ?? 1);
         int pageCount = lotService.Count() / pageSize;
         //TODO: выделить метод
         var lots = Mapper.Map<IEnumerable<LotViewModel>>(lotService.GetSomeLots(pageSize, (pageNumber - 1) * pageSize,search));                
         var viewModel = new IndexViewModel()
         {
             PageCount = pageCount,
             Page = pageNumber,
             Lots = lots,
             Categories = new List<Category>()
         };
         return View("Index", viewModel);
     }
     return RedirectToAction("Index");
 }