Is there a way to move an item of say id=10 as the first item in a list using LINQ?
Item A - id =5 Item B - id = 10 Item C - id =12 Item D - id =1
In th
You can "group by" in two groups with Boolean key, and then sort them
var finalList= allCountries .GroupBy(x => x.id != 592) .OrderBy(g => g.Key) .SelectMany(g => g.OrderBy(x=> x.id ));