public ActionResult Search() { var minPrice = Request.Form["S_MinPrice"]; var maxPrice = Request.Form["S_MaxPrice"]; var input = new SearchInput { genre = Request.Form["S_Genre"], title = Request.Form["S_Title"], released = Int32.Parse(Request.Form["S_Released"]), minPrice = minPrice != "" ? Decimal.Parse(minPrice) : 0, maxPrice = maxPrice != "" ? Decimal.Parse(maxPrice) : 0, includeMin = Boolean.Parse(Request.Form["S_IncludeMin"]), includeMax = Boolean.Parse(Request.Form["S_IncludeMax"]), validMin = minPrice != "", validMax = maxPrice != "" }; inputHistory.Push(input); var searchUtil = new SearchUtil { input = input }; var result = searchUtil.search(searchHistory.Count != 0 ? searchHistory.Peek() : db.Movies.ToList()); searchHistory.Push(result); return(RedirectToAction("Index")); }