title: Join table with linq into object-list in class
body: <p>I have to tables in SQL Database and want to join it with linq. I use Dapper to get to lists.</p>
  
  <p>How do i join this two tables with linq?</p>
  
  <pre><code>    var persons = new List&lt;Persons&gt;();
      var skills = new List&lt;Skills&gt;();
  
      public class Skill
      {
          public int PerID { get; set; }
          public int SkillID { get; set; }
          public string SkillName { get; set; }
          public DateTime SkillValidTo { get; set; }
      }
  
      public class Persons
      {
          public int PerID { get; set; }
          public string PerName { get; set; }
          public List&lt;Skill&gt; PerSkills { get; set; }
      }
  </code></pre>
  
  <p>this code don't work...</p>
  
  <pre><code>    persons = from per in personen
                join sk in skills on per.PerID = sk.PerID into joinedTable
                select new Persons()
                {
                    PerID = per.PerID,
                    PerName = per.PerName,
                    PerSkills = sk.Where(x =&gt; x.PerID == PerID).ToList() 
                } into joinedPersonsSkills
                select joindPersonsSkills;
  </code></pre>