예제 #1
0
 public IActionResult Index([FromQuery] string info, [FromQuery] bool search, [FromQuery] string txtName)
 {
     if (search)
     {
         var dogs = service.GetDogsByName(txtName).Result;
         ViewBag.Info = $"{dogs.ToList().Count} dogs found.";
         return(View(dogs));
     }
     if (info != null)
     {
         ViewBag.Info = info;
     }
     return(View(service.GetAll().Result));
 }