title: MVC Multiple Models in One View
body: <p>I want to reach multiple models in one view. I have DAL folder and DbContext.</p>
  
  <pre><code>class CvContext : DbContext
  {
     public CvContext() : base("CvContext")
     {
     }
  
     public DbSet&lt;LinkModel&gt; Links { get; set; }
     public DbSet&lt;AboutModel&gt; Abouts { get; set; }
     public DbSet&lt;PortfolioModel&gt; Portfolios { get; set; }
     public DbSet&lt;SkillModel&gt; Skills { get; set; }
  
     protected override void OnModelCreating(DbModelBuilder modelBuilder)
     {
        modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
     }
  }
  </code></pre>
  
  <p>And HomeController</p>
  
  <pre><code>public class HomeController : Controller
  {
     private CvContext db = new CvContext();
  
     public ActionResult Index()
     {
        return View(db.Links.ToList());
     }
  }
  </code></pre>
  
  <p>Index.cshtml</p>
  
  <pre><code>@model IEnumerable&lt;MvcCv.Models.LinkModel&gt;
  
  &lt;ul&gt;
     @foreach (var item in Model)
     {
        &lt;li&gt;
           &lt;a href="@Html.DisplayFor(modelItem =&gt; item.LinkUrl)"&gt;
                              @Html.DisplayFor(modelItem =&gt; item.LinkName)
              &lt;span class="icon"&gt;&lt;/span&gt;
              &lt;span class="menu-icon"&gt;
                 &lt;img src="@Url.Content(item.LinkImage)" alt="" /&gt;
              &lt;/span&gt;
           &lt;/a&gt;
        &lt;/li&gt;
     }
  &lt;/ul&gt;
  </code></pre>
  
  <p>How can i reach all models? I will use foreach for item in Model like Links. Thanks.</p>