title: Join between 3 table
body: <p>I have 3 table User,HumanCustomer,CompanyCustomer
  I want to join between tables with LINQ but my query is not working and its returning null</p>
  
  <p>Query:</p>
  
  <pre><code>var query = (from users in _ctx.Users
                           join hCustomer in _ctx.HumanCustomers on users.Id equals hCustomer.UserId
                           join cCustomer in _ctx.CompanyCustomers  on users.Id equals cCustomer.UserId
                           select new
                           {
                               users.Id,
                               users.Mobile,
                               hCustomer.LastName,
                               hCustomer.Name,
                               cCustomer.CompanyName
                           });
   foreach (var item in query)
              {
                  AllCustomerViewModel allCustomer = new AllCustomerViewModel();
  
                  if (item.Name != null)
                  {
                      allCustomer.UserId = item.Id;
                      allCustomer.FullName = item.Name + item.LastName;
                      allCustomer.Mobile = item.Mobile;
                      Customer.Add(allCustomer);
                  }
  }
  </code></pre>
  
  <p><strong>The code does not enter foreach</strong></p>
  
  <p>I think the problem is using UserId twice because when I delete </p>
  
  <pre><code>join cCustomer in _ctx.CompanyCustomers  on users.Id equals cCustomer.UserId
  </code></pre>
  
  <p>the query runs correctly.</p>