title: An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll
body: <p>I am trying to fetch the data using joins but it shows error when I get the <code>ParentHireGroupName</code>. It works fine when i do comment that line of code!</p>
  
  <p><strong>Function</strong></p>
  
  <pre><code>public IList&lt;RptFleetHireGroupDetail&gt; GetFleetReport()
          {
              var fleetHireGroupDetailQuery = from vehicle in DbSet                
                  join hgd in db.HireGroupDetails on
                      new {ModelID = vehicle.VehicleModelId, MakeID = vehicle.VehicleMakeId, CategoryId = vehicle.VehicleCategoryId, Year= vehicle.ModelYear }
                      equals new { ModelID = hgd.VehicleMakeId, MakeID = hgd.VehicleMakeId, CategoryId = hgd.VehicleCategoryId, Year = hgd.ModelYear }
                  select new RptFleetHireGroupDetail
                  {
                      HireGroupName = hgd.HireGroup.HireGroupName,
                      PlateNumber = vehicle.PlateNumber,
                      ParentHireGroupName = hgd.HireGroup.ParentHireGroup!=null? "kuch to hai":string.Empty,
  
                  };
              return fleetHireGroupDetailQuery.OrderBy(fhgd =&gt; fhgd.FleetPoolName).ToList();
          }
  </code></pre>
  
  <p><strong>RptFleetHireGroupDetail</strong></p>
  
  <pre><code>public class RptFleetHireGroupDetail
      {
          #region Public
          public string HireGroupName { get; set; }
          public string ParentHireGroupName { get; set; }
          public string PlateNumber { get; set; }
          #endregion
  }
  </code></pre>
  
  <p><strong>Additional error info :</strong>
  <em><code>Cannot compare elements of type 'HireGroup'. Only primitive types, enumeration types and entity types are supported.</code></em></p>