视图
<img src="@product.ImageSet.Images.LastOrDefault().ImageUrl" /> not working
<p>@product.ImageSet.Images.count</p> is working
控制器
using (var balikciContext = new BalikciContext())
{
var model = new ProductViewModel
{
Products = balikciContext.Products.Include("ImageSet").Include("ImageSet.Images").ToList(),
Categories = balikciContext.Categories.Where(c => c.ModuleId == 3).ToList()
};
return View(model);
}
我有经典错误消息&#34;对象引用没有设置为对象的实例&#34;
问题是什么