public ActionResult Search(SearchItemRequestModel input)
        {
            int page = 1;
            string word = "";
            if (input.Search != null)
            {
                word = input.Search;
            }

            var items = itemRepository.All().Where(i => i.Title.Contains(word) || i.Description.Contains(word));
            if (input.Category != null)
            {
                var categoriesString = String.Join("", input.Category);
                items = items.Where(i => categoriesString.Contains(i.Category.Name));
            }

            decimal totalPages = Math.Ceiling((decimal)items.Count() / input.PageSize);

            switch (input.Sort)
            {
                case "Description": items = items.OrderBy(e => e.Description).Skip((page - 1) * input.PageSize).Take(input.PageSize); break;
                case "Title": items = items.OrderBy(e => e.Title).Skip((page - 1) * input.PageSize).Take(input.PageSize); break;
                case "Date": items = items.OrderBy(e => e.DateCreated).Skip((page - 1) * input.PageSize).Take(input.PageSize); break;
            }

            var viewItems = items.ProjectTo<ItemResponseViewModel>();

            this.HttpContext.Cache["data"] = items;

            var viewData = new ItemSearchViewModel()
            {
                CurrentPage = page,
                Items = viewItems.ToList(),
                TotalPages = totalPages
            };

            return View("Index", viewData);
        }
 // GET: SearchItem
 public ActionResult Index(SearchItemRequestModel input)
 {
     return View();
 }