LINQ to Entities for subtracting 2 dates
- by Michael I
I am trying to determine the number of days between 2 dates using LINQ with Entity Framework. It is telling me that it does not recognize Subtract on the System.TimeSpan class
Here is my where portion of the LINQ query.
where ((DateTime.Now.Subtract(vid.CreatedDate).TotalDays < maxAgeInDays))
Here is the error I receive in the VS.NET debugger…