I\'m running into an issue in the View with pulling data from different entities. Basically I have a bridging entity CategoryProduct that brings together Category and Product da
Why can't you just change the viewmodel something like this
public class MyProduct
{
public int ProductId { get; set; }
public string Title { get; set; }
public virtual ICollection CategoryList { get; set; }
}
and view
@model IEnumerable
Index
Product
@Html.DisplayFor(modelItem => item.ProductId)
Categories for Product
@foreach (var item in Model.CategoryList) {
@Html.DisplayFor(modelItem => item.Title)
@Html.DisplayFor(modelItem => item.CategoryId)
}