title: LINQ to Entities does not recognize the method
body: <p>I have a problem with Linq to Entities that I can't find a workaround for.</p>
  
  <p>This is my code :</p>
  
  <pre><code>var queryResult = result.Where(x =&gt; x.FollowedUp.Value.GetWeekFromDateTime() 
      ==  DateTime.Now.GetWeekFromDateTime()).Select(x =&gt; x);
  </code></pre>
  
  <hr>
  
  <p>and my extention method is :</p>
  
  <pre><code>    public static int GetWeekFromDateTime(this DateTime date)
      {
          return System.Threading.Thread.CurrentThread.CurrentCulture.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
      }
  </code></pre>
  
  <hr>
  
  <p>Problem :</p>
  
  <p>I am getting "LINQ to Entities does not recognize the method GetWeekFromDateTime" and I understand why because it's trying to translate my code into sql code and of "GetWeekFromDateTime" does not exist. But how do I do it? I want to compare the weeknumber from date that I get from my database to this weeknumber.</p>
  
  <p>Thank you!</p>