此代码已经有效,但如何在现有LINQ中添加WHERE
子句?
ViewBag.UserType= new SelectList(_odb.USR_TYP_MSTR.OrderBy(o => o.USR_TYP_ID), "USR_TYP_ID", "USR_TYP_DESC");
答案 0 :(得分:1)
ViewBag.UserType= new SelectList(_odb.USR_TYP_MSTR.Where(o => o.USR_TYP_ID ==1 ).OrderBy(o => o.USR_TYP_ID), "USR_TYP_ID", "USR_TYP_DESC");