title: How can I join a list of employees and genders using linq
body: <p>I have retrieve a list of employees. my employee class columns(employeeId, lastname, genderid)</p>
  
  <pre><code> List&lt;m_employees&gt; Items = new List&lt;m_employees&gt;
                      {
                          new m_employees{ employeeid = 1, lastname = "mike", genderid = 1 },
                          new m_employees{ employeeid = 2, lastname = "jeni", genderid = 2 }
                      };
  </code></pre>
  
  <p>then i have my gender class columns (id, title) </p>
  
  <pre><code>    List&lt;m_genders&gt; genders = new List&lt;m_genders&gt;
                  {
                      new m_genders{ id = 1, title = "Male" },
                      new m_genders{ id = 2, title = "Female" }
                  };
  
  //then i tried joining the retrieved list of employees to the genders
  
  var x = from emp in Items
                      join sex in genders
                      on emp.genderid equals sex.id
                      into a from b in a.DefaultIfEmpty(new m_genders())
                      select new
                      {
                          emp.lastname,
                          emp.genderid,
                          sex = b.title
                      };
  </code></pre>
  
  <p>red error line is showing to the keyword join and says "the type of one of the expressions in the join clause is incorrect..."</p>
  
  <p>how can i join them properly?</p>