In my table i have two columns Email_ID & Role , for example (Email_ID : [email protected] & Role : Admin) and what I'am trying to do is avoid or not showing the users or those have Role as Admin , but the code i have now is showing all users.
My Code look like this :
- public ActionResult AllEmails(string searching, int? pageNumber)
- {
- return View(db.PX.Where(x => x.Email_ID.Contains(searching) ||
- searching == null).ToList().OrderBy(t => t.Role).ToPagedList(pageNumber ?? 1, 5));
- }
Sagar Pandurang KapRank #606 · 4K reputationPosted Jan 30, 2018, 10:12 PM EST
Man Down53 reputationPosted Jan 30, 2018, 10:15 PM EST
Man Down53 reputationPosted Jan 30, 2018, 11:30 PM EST
Sagar Pandurang KapRank #606 · 4K reputationPosted Jan 31, 2018, 12:14 AM EST
Man Down53 reputationPosted Jan 31, 2018, 1:23 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts