I have a method in my controller :
public ViewResult Index()
{
var orderdetail = db.OrderDetails.Include(o => o.Product).Include(o => o.Pack).Include(o => o.Order);
return View(orderdetail);
}
My View :
<td>
@Html.DisplayFor(modelItem => item.Order.Username)
</td>
<td>
@Html.DisplayFor(modelItem => item.Product.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Pack.Name)
</td>
In my view, it will show just the first include. So here, just my Product because Include(o => o.Product) is before my Include(o => o.Pack). If I put Pack first, it will display only my Pack. I want my view display both. How can i do this ?
Excuse me for my english and thank you for your help.
Doesn’t look like you can chain
Includecalls that way, you will have to build your query up explictly e.g.