title: linq join with case condition
body: <p>Hi may i know how to do a select "case" condition in using linq?
  The commented out code are my question. how do i put the condition there?
  my code:</p>
  
  <pre><code>var r = from u in Users
      join p in Payments on u.Id equals p.UserId
      join soi in SaleOrderItems on p.ReferenceId equals soi.Id
             //if soi.InventoryTypeId == 1
                //then join i in Inventories on soi.InventoryOrCourseId equals i.Id
             //elseif soi.InventorytypeId ==2
                //then join c in Courses on soi.InventoryOrCourseId equals c.Id
      where u.Id == 5
      select new{ u, p, soi, either i or c};
  </code></pre>