var s = myInventoryEntities.p_Forms().Select(i => new { i.Customer, i.Order_ID }).Distinct().ToList();
ViewBag.MyData = s;
return View();
这给了我
{ Customer = "Bob", Order_ID = 2644550 }
在我的剃须刀代码中
我遍历数据
@foreach ( var x in @ViewBag.MyData){
x.Customer // Does not exist! :(
}
请帮忙!
“对象”不包含“客户”的定义