public IActionResult Search(string searchString) { string _searchString = searchString; IEnumerable <Snack> snacks; if (string.IsNullOrEmpty(_searchString)) { snacks = _snackRepository.FindAll(); } else { snacks = _snackRepository.GetByStringSearch(_searchString); } return(View(snacks)); }