I have a LINQ query that is currently like this:
var query = from l in Records
where l.time >= time1 && l.time <= time2
select l;
however, the Records collection used to log once every two seconds, now it logs once an hour. I need a way of only grabbing one Record an hour from the old data, so that the returned data makes more sense, and so I don’t return months of data logged every 2 seconds…Any help would be great.
So you want only one record per hour. That means you need to group by hour: