title: Opertor '==' cannot be applied to operands of type 'int?' and 'string' on where clause
body: <p>While executing below linq query on controller, I got this error:</p>
  
  <blockquote>
    <p>Opertor '==' cannot be applied to operands of type 'int?' and 'string'</p>
  </blockquote>
  
  <p>Controller:</p>
  
  <pre><code>from t in db.ASN_ITEM
      join t0 in db.ITEM_MASTER on t.ITEM_MASTER.ITEM_CODE equals t0.ITEM_CODE        
      where
           t.REGION_ID == RegionId &amp;&amp; 
           (Status == "" || Status == "-1" || t.SCAN_STAT == Status)
  </code></pre>
  
  <p>Here type of <code>t.SCAN_STAT</code> is <code>int?</code> and type of variable <code>status</code> is <code>string</code>.</p>
  
  <p>I have tried this one:</p>
  
  <pre><code>(Status == "" || Status == "-1" || SqlFunctions.StringConvert((double)t.SCAN_STAT) == Status)
  </code></pre>
  
  <p>But not fetching the desired data based on the condition.</p>
  
  <p>When I tried <code>(Status == "" || Status == "-1" || t.SCAN_STAT.ToString() == Status)</code>, I got this error:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.</p>
  </blockquote>
  
  <p>These are the solutions I got from other sites.
  Now how can I solve this error?</p>