title: Compare DateTime as a string into a LINQ to Entities doesn't recognize DateTime.parse(string)
body: <p>I'm developing a WCF RESTful service with C#, .NET Framework 4.0 and <strong>Entity Framework Code First</strong>.</p>
  
  <p>I have this class (that represents a table on database):</p>
  
  <pre><code>[DataContract]
  public class PostLine
  {
      public int PostLineId { get; set; }
  
      [DataMember]
      public int? UserId { get; set; }
  
      [DataMember]
      public string Description { get; set; }
  
      [DataMember]
      public string DateUtc { get; set; }
  
      public User Author { get; set; }
  }
  </code></pre>
  
  <p>And I'm trying to do this:</p>
  
  <pre><code>DateTime fourDaysAgo = DateTime.Now.Date.AddDays(-4);
  
  var postLines = 
      context.PostLines.Where(p =&gt; DateTime.Compare(DateTime.Parse(p.DateUtc), fourDaysAgo) &gt; 0).Include("Author");
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <p><code>{System.NotSupportedException: LINQ to Entities doesn't recognize the method 'System.DateTime Parse(System.String)', which can not be converted into an expression of the repository.</code></p>
  
  <p>I need that <code>PostLine.DateUtc</code> to be a string because I'm going to use it on my web service, and send it as JSON, so its better for me to store it as a string.</p>
  
  <p>If I use <code>DateTime</code> type, I'm going to get something like this on JSON response:</p>
  
  <pre><code>{
      "DateUtc": "/Date(1380924000000+0200)/",
      "Description": "post_1",
      "UserId": 1
  }
  </code></pre>
  
  <p><strong>Do you know how can I compare a string with a DateTime on a LINQ expression?</strong></p>