How to create a new DateTime where condition using table field with LINQ
<p>i have a win application in c# where i would obtain a linq query with a where condition containing a Data concatened by table fields.
my query is :</p>

<pre><code>var fatture = (from t016 in cont.T016_FATT
              where t016.ID_FATTURA = aiIdFattura
              &amp;&amp; Convert.toDateTime("01" + t016.COD_MESE+"/"+t016.ANNO) &gt; aiData
              select t016).ToList();
</code></pre>

<p>where <code>t016.COD_MESE</code> is a string rapresenting month value, <code>aiIdFattura</code> is a decimal parameter passed in function and aiData is a DateTime parameter.</p>

<p>but this linq query gives me this error:</p>

<blockquote>
  <p>LINQ to Entities does not recognize the method Convert.ToDateTime</p>
</blockquote>

<p>i have found in internet a solution suggesting to use DBFunctions that is present in EntityFramework (version 6) but i have a minor version of EntityFramework  so i cannot use this function.</p>

<p>another found solution was to format date before linq query but in my case is not possible because depending from T016_FATT so i cannot format my date first.</p>

<p>so have you any idea to suggest me?</p>

<p>thanks a lot</p>