New to LINQ.. I am curious as to the syntax to do the following SQL query in LINQ
SELECT MAX(TMPS), DAY FROM WEATHERREADINGS
GROUP BY WEATHERREADINGS.DAY
What I have so far:
var minTemps = from ps in ww.WEATHERREADINGS
group ps by ps.DATE.Hour into psByHour
select new
{
HourOfDay = psByHour.Max().DATE.Hour,
MaxTemp = psByHour.Max().TMPS
};
I am getting the following error while doing this:
Exception Details: System.InvalidOperationException: Could not format node 'New' for execution as SQL.
any help greatly appreciated!!