title: The type of one of the expressions in the join clause is incorrect in Entity Framework
body: <p>While trying to execute this query: </p>
  
  <pre><code>var query = from dpr in ctx.DPR_MM
              join q in ctx.QOT on dpr.DPR_QOT_ID equals qot_id
              join p in ctx.PAY_MM on new { q.QOT_SEC_ID, dpr.DPR_TS } equals new { p.PAY_SEC_ID, p.PAY_DATE }
              where q.QOT_ID = qot_id
              select new
              {
                  dpr.dpr_ts,
                  dpr.dpr_close,
                  pay.First().pay_dividend
              };
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <blockquote>
    <p>The type of one of the expressions in the join clause is incorrect.
    Type inference failed in the call to 'Join'.</p>
  </blockquote>
  
  <p><code>QOT_SEC_ID</code> is of type <code>decimal</code> and  <code>PAY_SEC_ID</code> is of type <code>int32</code>.
  I'm not allowed to change it in the table.</p>
  
  <p>No matter what I do, I'm not able to change it in model's properties.
  I have tried to convert the types like this:</p>
  
  <pre><code>join p in ctx.PAY on new { sec_id = (Int32)(q.QOT_SEC_ID), dpr.DPR_TS } equals new { sec_id = (Int32)p.PAY_SEC_ID, p.PAY_DATE }
  </code></pre>
  
  <p>but getting the error above.</p>