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
public static IEnumerable ServeFirst(this IEnumerable source, Predicate p) { var list = new List(); foreach (var s in source) { if (p(s)) yield return s; else list.Add(s); } foreach (var s in list) yield return s; }