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));
- }
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Man DownPosted Jan 31, 2018, 6:23 AM
Sagar Pandurang KapPosted Jan 31, 2018, 5:14 AM
Man DownPosted Jan 31, 2018, 4:30 AM
Man DownPosted Jan 31, 2018, 3:15 AM
Sagar Pandurang KapPosted Jan 31, 2018, 3:12 AM