using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { List destinations = new List() { new Destination() { A = 1, B = 1 }, new Destination() { A = 1, B = 2 }, new Destination() { A = 2, B = 1 } }; List sources = new List() { new Source() { A = 1, B = 1, C = "a" }, new Source() { A = 2, B = 1, C = "b" }, new Source() { A = 2, B = 1, C = "c" }, new Source() { A = 1, B = 1, C = "d" }, new Source() { A = 2, B = 2, C = "e" } }; var lookup = sources.ToLookup(s => new { s.A, s.B }, s => s.C); foreach (var d in destinations) d.Cs = lookup[new { d.A, d.B }].ToList(); // results Console.WriteLine("A B Cs"); foreach(var d in destinations) { Console.WriteLine("{0}-{1}: {2}", d.A, d.B, String.Join(",", d.Cs.Cast().ToArray())); } } } class Source { public object A { get; set; } public object B { get; set; } public object C { get; set; } } class Destination { public object A { get; set; } public object B { get; set; } // (A,B) is a unique key public List Cs { get; set; } public object D { get; set; } }