I'm just began new project, using ASP.NET MVC 4, and I have question.
How I may use multiple models (or ViewModel-s) in one view? I'm searched over Internet, and standard solution is "create complex viewmodel with 2 or more properties", e.g.:
public class ComplexViewModel
{
public LoginModel LoginModel { get; set; }
public CartModel CartModel { get; set; }
}
But, for example, in each page I'll have at least 2 model - LoginModel and another model (depends on page). So, I need to define LoginModel in each ViewModel?
P.S.: I'm using ASP.NET MVC 4, Entity Framework 5.