If you don't already have a view model to represent this, just create one:
public class MyViewModel
{
public Engineer Engineer { get; set; }
public List Elements { get; set; }
}
Populate a set of view models in the controller
public ActionResult MyAction()
{
var viewModels =
(from e in db.Engineers
select new MyViewModel
{
Engineer = e,
Elements = e.Elements,
})
.ToList();
return View(viewModels);
}
And in your view just specify that you're using a collection of view models:
@model List
@foreach(var vm in Model)
{
Projects for engineer: @vm.Engineer.Name
@foreach(var ele in vm.Elements)
{
- @ele.Name
}
}