The problem is that I need to "call" the PersonName field in the view of School, but the model in the view School is @model IList<Project.Presentation.Models.SchoolViewModel>, and the field PersonName is in the model @model IList<Project.Presentation.Models.PersonViewModel>. So, I guess I have to use two models in the same view, but I don't know how to do it. I don't know if I can only "call" the field I need using just one code line or if I have to do something behind.
Here is the code in the view School:
@model IList<Project.Presentation.Models.SchoolViewModel>
@{
ViewBag.Title = "Start view";
}@
{
<div class="row">
<div class="col-md-6 ">
<h2>
Details of the person @Html.DisplayFor(Project.Presentation.Models.PersonViewModel.PersonName)
</h2>
</div>
</div>
}
I'm trying with@Html.DisplayFor(Project.Presentation.Models.PersonViewModel.PersonName), but obviously it doesn't works.