title: The model item is of type CookMeIndexViewModel, but requires a model item of type IEnumerable<CookMeIndexViewModel>
body: <p>I am following along with the music store example to try learn ASP.NET MVC. I'm creating a cookbook application. </p>
  
  <p>I have created my viewmodel that looks like this:</p>
  
  <pre><code>namespace CookMe_MVC.ViewModels
  {
      public class CookMeIndexViewModel
      {
          public int NumberOfReceipes { get; set; }
          public List&lt;string&gt; ReceipeName { get; set; }
      }
  }
  </code></pre>
  
  <p>my controller looks like this   </p>
  
  <pre><code>public ActionResult Index()
      {
          var meals= new List&lt;string&gt; { "Dinner 1", "Dinner 2", "3rd not sure" };
         //create the view model
          var viewModel = new CookMeIndexViewModel
          {
              NumberOfReceipes = meals.Count(),
              ReceipeName = meals
          };
          return View(viewModel);
      }
  </code></pre>
  
  <p>Finally my view looks like this   </p>
  
  <pre><code> @model IEnumerable&lt;CookMe_MVC.ViewModels.CookMeIndexViewModel&gt;
  
  @{
      ViewBag.Title = "Index";
  }
  
  &lt;h2&gt;Index&lt;/h2&gt;
  
  &lt;p&gt;
      @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;&lt;/th&gt;
          &lt;th&gt;
              Meals
          &lt;/th&gt;
      &lt;/tr&gt;
  
  @foreach (var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
              @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
              @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
          &lt;/td&gt;
          &lt;td&gt;
              @item.ReceipeName
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  
  &lt;/table&gt;
  </code></pre>
  
  <p>I get this error. </p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type <code>CookMeIndexViewModel</code>, but this dictionary requires a model item of type <code>IEnumerable&lt;CookMeIndexViewModel&gt;</code>.</p>
  </blockquote>
  
  <p>I have followed the example. I can't see what I am doing wrong. Should I be  returning my viewmodel as a generic list?</p>