如何在WHERE
中使用ViewBag
在当前LINQ
中添加第二个Controller
子句('AND')?谢谢!
ViewBag.Subjects = new SelectList(_odb.SUBJ_MSTR.
Where(o => o.TYPE== "4").OrderBy(o => o.SUBJ_NAME), "SUBJ_ID", "SUBJ_VAL");
答案 0 :(得分:1)
您可以像&&
这样添加WHERE
。
ViewBag.Subjects = new SelectList(_odb.SUBJ_MSTR.
Where(o => o.TYPE== "4" && o.TYPE=="5").OrderBy(o => o.SUBJ_NAME), "SUBJ_ID", "SUBJ_VAL");