In my return view (), how can I return two or more lists? These lists are the results of a linq query.
In my return view (), how can I return two or more lists? These lists are the results of a linq query.
You can put it in the ViewBag
ViewBag.Lista1 = new List<>();
ViewBag.Lista2 = new List<>();
return View();
Then the View you access the same way:
@ViewBag.Lista1
Now you can if you want, create a C # ViewModel class that is wrapper by joining the two lists in a new class
return View(new MyViewModel{ Lista1 = new List<>(), Lista2 = new List<>() });
There you will see:
@Model.Lista1
Exit?