I have list which I want to order by like this
- First by "ab"
- Then by alphabetical order inside the list by "ab"
- Then by "cd"
- Then by alphabetical order inside the list by "cd"
- Then by "ef"
- Then by alphabetical order inside the list by "ef"
and then the rest by alphabetical order
I have this linq query
var groups = profileModel.Groups.
OrderByDescending(i => i.FullName.ToLower().Contains("ab")).
ThenByDescending(i => i.FullName.ToLower().Contains("cd")).
ThenByDescending(i => i.FullName.ToLower().Contains("ef"));
How should I extend this one? Do I have to use group by?