title: join of two lists in c#
body: <pre><code>public class Co
  {
      public int Id { get; set; }
      public string Title { get; set; }
      public List&lt;string&gt; Cards { get; set; }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          List&lt;Co&gt; coll = new List&lt;Co&gt;();
          Co c1 = new Co();
          c1.Id = 1;
          c1.Title = "A";
          coll.Add(c1);
          Co c2 = new Co();
          c2.Id = 2;
          c2.Title = "B";
          coll.Add(c2);
          List&lt;KeyValuePair&lt;int, int&gt;&gt; list = new List&lt;KeyValuePair&lt;int, int&gt;&gt;();
          list.Add(new KeyValuePair&lt;int, int&gt;(1, 2));
          list.Add(new KeyValuePair&lt;int, int&gt;(1, 3));
          list.Add(new KeyValuePair&lt;int, int&gt;(1, 1));
          list.Add(new KeyValuePair&lt;int, int&gt;(2, 1));
  
          Console.ReadKey();
      }
  </code></pre>
  
  <p>I want to assign Cards property for all the objects in <code>coll</code> with comma separated values of value in <code>list</code>  by comparing the id from object in <code>coll</code> with key from <code>list</code></p>
  
  <p>Output: for first object c.Cards ="2,3,1"
          for second object c.cards= "1"</p>
  
  <p>I'm able to do it with foreach loops. Can anyone tell me the solution with linq?</p>