using System.Collections.Generic;
public static void Main()
new SampleData{ ID = 1, Tags = "acronym, address" , Name = "one" },
new SampleData{ ID = 2, Tags = "applet, abbr , embed" , Name = "two" },
new SampleData{ ID = 3, Tags = "iframe, abbr", Name = "three" },
new SampleData{ ID = 4, Tags = "abbr, bgsound, bdo", Name = "four" },
new SampleData{ ID = 5, Tags = "img, acronym", Name = "five" }
var orderedKeyMapping = data.SelectMany(p => p.Tags.Split(',')).Select(x => x.Trim())
.ToDictionary(g => g.Key.ToString(), g => g.Count())
.OrderByDescending(p => p.Value);
var result = data.Select(p => new
Weight = orderedKeyMapping.FirstOrDefault(o => p.Tags.Split(',').Select(x => x.Trim()).Any(tag => o.Key.Equals(tag))).Value
}).OrderByDescending(p => p.Weight)
.Select(p => p.SampleData);
Console.WriteLine(JsonConvert.SerializeObject(result));
public string Tags {get;set;}
public string Name {get;set;}