using System; using System.Linq; using System.Collections.Generic; class Product { public int ID; public int CategoryID; } public class Test { public static void Main() { var products = new List(); products.Add(new Product() { ID = 1, CategoryID = 1 }); products.Add(new Product() { ID = 2, CategoryID = 1 }); products.Add(new Product() { ID = 3, CategoryID = 7 }); products.Add(new Product() { ID = 4, CategoryID = 8 }); products.Add(new Product() { ID = 5, CategoryID = 9 }); products.Add(new Product() { ID = 6, CategoryID = 10 }); var catIDs = new[] { 1, 8, 9 }; var ordered = products .OrderByDescending(p => catIDs.Contains(p.CategoryID)) .ThenBy(p => p.CategoryID); Console.Write( string.Join(Environment.NewLine, ordered.Select(p => String.Format("ID={0} CatID={1}",p.ID,p.CategoryID)).ToArray())); } }