I have a list of SelectListItems like this:
List<SelectListItem> test = new List<SelectListItem>
{
new SelectListItem { Text="aaa", Value ="1"},
new SelectListItem { Text="ttt", Value="2"},
new SelectListItem { Text="bbb", Value = "3"},
new SelectListItem { Text="other", Value = "4"}
}.OrderBy(x => x.Text).ToList();
This above code return the ordered list like this:
- aaa
- bbb
- other
- ttt
I would like to order my list but keep the item named ‘other’ at the bottom of the list.
How is it possible?
Maybe this will work