title: Unknown column in field list - After MySQL changes
body: <p>I have a query which pulls some data after making a couple of joins, this worked fine when the application used SQL Server. However after making the transfer to MySQL I'm having some issues. </p>
  
  <p>For example I keep getting the error 'Unknown column Extent.Group_ClientID'. I have identified the line at which this error occurs at but I don't understand why.</p>
  
  <p>Entity:</p>
  
  <pre><code>[Table("tblsupplier")]
      public partial class Supplier
      {
          [Key][Column(Order = 0)]
          public int ClientID { get; set; }
  
          [Key][Column(Order = 1)]
          public int SupplierID { get; set; }
  
          [StringLength(50)]
          public string AccountNo { get; set; }
  
          [StringLength(100)]
          public string SupplierName { get; set; }
  
          public string DisplayName {
              get {
                  return this.SupplierName + " (" + this.AccountNo + ")";
              }
          }
  
          public virtual Client tblClient { get; set; }
      }
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code> public IQueryable&lt;Supplier&gt; GetAllSuppliersByClientWithClaims(int ClientID, List&lt;int&gt; WrittenOffIDs) {
              return (from s in alliance.Suppliers
                      where s.ClientID == ClientID
                      join h in alliance.Headers
                      on new { a = s.ClientID, b = s.SupplierID }
                      equals new { a = h.ClientID, b = h.SupplierID }
  
                      join d in alliance.Details
                      on new { h.ClientID, h.ClaimID }
                      equals new { d.ClientID, d.ClaimID }
  
                      join r in alliance.Reviews
                      on new { h.ClientID, h.ReviewID }
                      equals new { r.ClientID, r.ReviewID }
                      where r.ReviewPeriodID != 0
                      where d.SplitLine == false
                      where !WrittenOffIDs.Contains((int)d.WrittenOffID)
  
  
  
   select s).Distinct().OrderBy(r =&gt; r.SupplierName);
      }
  </code></pre>
  
  <p>Method:</p>
  
  <pre><code>public string GetSupplierAutoComplete(int ClientID) {
              DashboardViewModel model = new DashboardViewModel();
              GeneralMethods GeneralHelpers = new GeneralMethods(reviewPeriodRepo, supplierGroupRepo, detailRepo);
  
              model.Suppliers = supplierRepo.GetAllSuppliersByClientWithClaims(ClientID, GeneralHelpers.GetWrittenOffCodes(ClientID));
  
             //Fails here
              return JsonConvert.SerializeObject(model.Suppliers.Select(r =&gt; r.DisplayName), Formatting.Indented);
              }
  </code></pre>
  
  <p>However, I have done some playing around and I've found that one of the where's in the query is causing this issue.  <code>where d.SplitLine == false</code>. Now in the database SplitLine is a Tinyint. As suggested because this is the boolean type for MySQL. Now if I pull a single 'SplitLine', it will return true or false based on the 0 or 1. Whereas if I use it in a where statement, it fails. Why it this?</p>
  
  <p>UPDATE:</p>
  
  <p>This only seems to happen when I enumerate the list</p>