var vals = (from r in result
group r by DbFunctions.TruncateTime(r.Created) into g
select new { count = g.Count(), date = g});
When I try to run the above I get the following error
Results
is the result of a DB query
"This function can only be invoked from LINQ to Entities."
The model (result
) returns Dates (amongst other things), all I'm trying to do is group by the date (created
) and work out how many times it existed.
Created
is already DateTime
What am I doing wrong?