'对象'不包含' ID'的定义

时间:2014-01-25 09:28:02

标签: c# entity-framework asp.net-mvc-4

控制器代码

var list = (from c in db.table where c.SUPERVISOR_ID == EmployeeId select new  {ID=c.PERSON_ID,Name=c.PERSON_NAME }).ToList();

ViewBag.BrList = list;

return View();

剃刀代码:

   @foreach (var br in ViewBag.BrList)
   {
     <option value="@br.ID">@br.Name</option> //throws error 
  }

上面提到的代码给出错误 - 'object'不包含'ID'的定义

0 个答案:

没有答案