title: Error: Model Item passed into dictionary missmatch
body: <p>Im tring to make a custom viewmodel class which takes 2 model list or enumerable. when I try to show in a view class it gives me following error.</p>
  
  <p>The model item passed into the dictionary is of type ""Prototype01.ViewModels.StockViewModel', but this dictionary requires a model item of type 'System.Collections.Generic.IList`1[Prototype01.ViewModels.StockViewModel]""</p>
  
  <p>I have tried making seperate views and used simple models to project in a view. it works fine but when i try to get viewmodel it does not works as i expect.</p>
  
  <pre><code>public class StockController : Controller
  </code></pre>
  
  <p>{</p>
  
  <pre><code>    private ApplicationDbContext _context;
  
      public StockController()
      {
          _context = new ApplicationDbContext();
      }
  
      protected override void Dispose(bool disposing)
      {
          _context.Dispose();
      }
  
      // GET: Stock
      public ActionResult StockIndex()
      {
          var batteries = _context.Batteries.ToList();
          var rims = _context.Rims.ToList();
          var viewmodel = new StockViewModel
          {
              Batteries = batteries,
              Rims = rims
          };
  
          return View(viewmodel);
      }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public class StockViewModel
  {
      public IEnumerable&lt;Battery&gt; Batteries { get; set; }
      public IEnumerable&lt;Rim&gt; Rims { get; set; }
  }
  
          @model IEnumerable&lt;Prototype01.ViewModels.StockViewModel&gt;
  @{
  ViewBag.Title = "StockIndex";
  Layout = "~/Views/Shared/_Layout.cshtml";
  }
  &lt;h2&gt;Stock Management&lt;/h2&gt;
  
  @if (!Model.Any())
  {
  &lt;p&gt;We don't have any Batteries yet.&lt;/p&gt;
  &lt;label class="btn-group"&gt;@Html.ActionLink("Add New", "New", "Battery") 
   &lt;/label&gt;
   }
   else
   {
  &lt;table class="table table-bordered table-hover"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;battery ID&lt;/th&gt;
              &lt;th&gt;battery Name&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          @foreach (var bt in Model)
          {
              &lt;tr&gt;
                  &lt;td&gt; tying to show batteries here&lt;/td&gt;
              &lt;/tr&gt;
          }
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;table class="table table-bordered table-hover"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Rim ID&lt;/th&gt;
              &lt;th&gt;Rim Name&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          @foreach (var rm in Model)
          {
              &lt;tr&gt;
                  &lt;td&gt; tying to show Rims here&lt;/td&gt;
              &lt;/tr&gt;
          }
      &lt;/tbody&gt;
    &lt;/table&gt;
  </code></pre>
  
  <p>}</p>
  
  <p>I am trying to store data in controller method and send viewmodel to just show 2 tables with Id and name from database table Batteries and Rims</p>
  
  <p>on the other hand, I am getting an exception 
  The model item passed into the dictionary is of type 'Prototype01.ViewModels.StockViewModel', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[Prototype01.ViewModels.StockViewModel]'.</p>