I have a simple checkbox that fills my bag like:
ViewBag.stuId_FK = new SelectList(db.CLS_Students, "stuId", "student");
It works great. What I'm trying to do is filter the conditions using the where clause (an example where my "position" field is 1).
I have this code, but I don’t think it is for sure.
ViewBag.stuId_FK = new SelectList(db.CLS_Students, "stuId", "student").Where(o=>o.positionID==1);
Any help would be appreciated. Thank.
Grace source
share