For Example: Let's say that I want to return a view that displays a list of cars and also show a section of dealers in your area. These are two disjointed pieces of data.
My view inherits a list of cars like the following:
public partial class CarLot : ViewPage<List<Cars>>
{
}
Now from the controller I can return the view like the following:
return View(Model.GetCars());
To render this, my markup would look something like the following:
<% foreach (Car myCar in ViewData.Model)
{some html here}
%>
This takes care of the list of cars, but my question is, how do I handle the list of dealers? Does the view support multiple inheritance or am I going to have to hit the model again form the markup? I know it can be done that way, but am not sure if it is the best practice.