title: How to use two IENumerable models in one view
body: <p>I am trying to use two models in one view, but from what I understand my program just don't see any objects within models.</p>
  
  <p>Here is my code.</p>
  
  <p>Models:</p>
  
  <pre><code>    public class Album
      {
          [Key]
          public int ThreadId { get; set; } 
          public int GenreId { get; set; }
          public string Title { get; set; }
          public string ThreadByUser { get; set; } 
          public string ThreadCreationDate { get; set; }
          public string ThreadContent { get; set; } 
          public Genre Genre { get; set; }
          public List&lt;Posts&gt; Posty { get; set; }
      }
      public class Posts 
      {
          [Key]
          public int PostId { get; set; }
          public int ThreadId { get; set; } 
          public string PostTitle { get; set; }
          public string PostContent { get; set; }
          public string PostDate { get; set; }
          public string PosterName { get; set; }
          public Album Album { get; set; }
  
      }
  
      public class ModelMix
      {
          public IEnumerable&lt;Posts&gt; PostsObject { get; set; }
          public IEnumerable&lt;Album&gt; ThreadsObject { get; set; }
      }  
  </code></pre>
  
  <p>Index controller code:</p>
  
  <pre><code>    public ActionResult Index(int id)
      {
  
          ViewBag.ThreadId = id;
          var posts = db.Posts.Include(p =&gt; p.Album).ToList();
          var albums = db.Albums.Include(a =&gt; a.Genre).ToList();
  
          var mixmodel = new ModelMix
          {
              PostsObject = posts,
              ThreadsObject = albums
          };
  
          return View(mixmodel);
      }
  </code></pre>
  
  <p>View code:</p>
  
  <pre><code>@model MvcMusicStore.Models.ModelMix
  
  &lt;h2&gt;Index&lt;/h2&gt;
  
  @Html.DisplayNameFor(model =&gt; model.PostsObject.PostContent)
  </code></pre>
  
  <p>And when I try to execute my program I am getting this error:</p>
  
  <blockquote>
    <p>CS1061: The "
    System.Collections.Generic.IEnumerable 'does not contain a definition
    of" PostContent "not found method of expanding" PostContent ", which
    takes a first argument of type' System.Collections.Generic.IEnumerable
     "</p>
  </blockquote>
  
  <p>How I can make it work as intended? There are a lot of questions like mine on the internet but I couldn't find any matching my case.</p>