title: How to compare datepart Month using Nhibernate Criteria?
body: <p>This is my code:</p>
  
  <pre><code>   public IList&lt;VotacaoPlenario&gt; RetornarVotacao(int mesInicio, int anoInicio)
      {
          DetachedCriteria criteria = DetachedCriteria.For&lt;VotacaoPlenario&gt;();
  
          if (anoInicio &gt; 0)
          { 
              criteria.Add(Expression.Eq("YEAR(Data)", anoInicio));
  
          }
  
          IList&lt;VotacaoPlenario&gt; votacao = criteria.GetExecutableCriteria(Session).List&lt;VotacaoPlenario&gt;();
  
  
          return votacao;
      }
  }
  </code></pre>
  
  <p>In my table de field Data is Datime i'm need to compare with the variable anoInicio which is int How can i do that?</p>