title: How to pass an IEnumerable model to a partial view in MVC
body: <p>This is my layout from where I calling the partial veiw.<br>
    This is the code where i got error.  </p>
  
  <blockquote>
    <p>CS0144  Cannot create an instance of the abstract class or interface 'IEnumerable'</p>
  </blockquote>
  
  <pre><code>&lt;div class="fa fa-group"&gt;
    @Html.Partial("_Comment", new IEnumerable&lt;OnlineTaxiReservationSystem.Models.Comment&gt;)
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my partial view.  </p>
  
  <pre><code>@model IEnumerable&lt;OnlineTaxiReservationSystem.Models.Comment&gt;
  
  &lt;p&gt;
  @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table class="table"&gt;
  &lt;tr&gt;
      &lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.UserComments)
      &lt;/th&gt;
      @*&lt;th&gt;
          @Html.DisplayNameFor(model =&gt; model.UserId)
      &lt;/th&gt;*@
      &lt;th&gt;&lt;/th&gt;
  &lt;/tr&gt;
  
  @foreach (var item in Model) {
  &lt;tr&gt;
      &lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.UserComments)
      &lt;/td&gt;
      @*&lt;td&gt;
          @Html.DisplayFor(modelItem =&gt; item.UserId)
      &lt;/td&gt;*@
      &lt;td&gt;
          @Html.ActionLink("Edit", "Edit", new { id=item.CommentId }) |
          @Html.ActionLink("Details", "Details", new { id=item.CommentId }) |
          @Html.ActionLink("Delete", "Delete", new { id=item.CommentId })
      &lt;/td&gt;
  &lt;/tr&gt;
  }
  &lt;/table&gt;
  </code></pre>