Пример #1
0
        // Process search submission and display search results
        public IActionResult Results(SearchAnimalsViewModel animalsViewModel)
        {
            if (animalsViewModel.Column.Equals(AnimalFieldType.All) || animalsViewModel.Value.Equals(""))
            {
                animalsViewModel.Animals = animalData.FindByValue(animalsViewModel.Value);
            }
            else
            {
                animalsViewModel.Animals = animalData.FindByColumnAndValue(animalsViewModel.Column, animalsViewModel.Value);
            }

            animalsViewModel.Title = "Search";

            return(View("Index", animalsViewModel));
        }