Here’s a LINQ statement that I am trying to execute
var usersQuery =
from user in Model.Users
select user.Plates;
var platesQuery =
from plate in usersQuery
group plate by plate.Time into grouping
select grouping;
I get the following error
System.Collections.Generic.List<AllYourPlates.Domain.Entities.Plate>' does not contain a definition for 'Time' and no extension method 'Time' accepting a first argument of type 'System.Collections.Generic.List<AllYourPlates.Domain.Entities.Plate>' could be found (are you missing a using directive or an assembly reference?
I can’t figure out what the problem is.
usersQueryis anIEnumerable<IEnumerable<Plate>>you can either rectify this in yourplatesQuerylike this:Or flatten out the initial results so you have an
IEnumerable<Plate>instead: