I have a Linq query:
people.Where(x => EntityFunctions.DiffHours(x.CreateDate, dtMatch) > 0)
Linq 2 Entities
people.Where(x => (x.CreateDate - dtMatch).TotalHours > 0)
In short: To make the 2 statements equivalent change
Math.Floor((x.CreateDate - dtMatch).TotalHours)
people.Where(x => Math.Floor((x.CreateDate - dtMatch).TotalHours) > 0)
TotalHours will return a decimal. So if there was 30 minutes between the 2 dates then
0.5 would be returned. As .5 is greater than 0 the above returns true. If you want whole hours change it to Math.Floor(TotalHours) instead of
TotalHours. This will round it down to the next largest integer.
EntityFunctions.DiffHours - This returns an integer representing the whole number of hours, so if it was 30 min. difference then 0 would be the result.