Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
Nicholas Mabe
2k
30
542
How to filter a public IEnumerable<SelectListItem> with .Where?
Jan 9 2021 9:09 AM
Very new to Net Core and CSharp, I am trying to filter a list before it posts
proposalVM.ProposalCategoryList = _unitOfWork.ProposalCategory.GetAll().OrderBy(s => s.ProposalCategoryName)
.Where(s => s.ProposalCategoryName != "Freight")
.Select(i => new SelectListItem
{
Text = i.ProposalCategoryName,
Value = i.ProposalCategoryId.ToString()
});
I don't get an error but neither does it filter the list. Any help is gratefully received.
Reply
Answers (
4
)
How to set no. in array dynamically?
Data Saving After Closing