I am trying to display the default index page for a model. But I get the below error.
The model item passed into the dictionary is of type 'System.Collections.Generic.List 1[System.Boolean]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[EDIWebsite.Models.Error_Details]'.
Controller
public ActionResult FindRelatedBols(string bolnumber)
{
if (bolnumber == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
var error_Summaries = db.Error_Details.Select(r => r.BOL == bolnumber);
if (error_Summaries == null)
{
return HttpNotFound();
}
return PartialView("~/Views/Error_Details/Index.cshtml",error_Summaries.ToList());
}
View
@model IEnumerable<EDIWebsite.Models.Error_Details>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Source_System)
</th>
.
.
.
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
</td>
</tr>
}
</table>