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
To also check if the item was found without Exception, something like:
var allCountries = repository.GetCountries(); var lookup = allCountries.ToLookup(x => x.id == 592); var finalList = lookup[true].Concat(lookup[false]).ToList(); if ( lookup[true].Count() != 1 ) YouAreInTrouble();