Trying to work out a linq query and was wondering if you guys could help.
I have a list of objects foo
and each foo
object has a list of <
Check it as well...
var q = from e in Entries
select new
{
EntryID = e.EntryID,
EntryName = e.EntryName,
EntryDescription = e.EntryDescription,
VoterID = voterID,
Score = (int?)(from v in e.Votes
where v.VoterID == voterID
select v.Score).FirstOrDefault()
Looks like you want:
var query = from foo in list
from bar in foo.Bars
group bar.Value by bar.Date into dates
select new { Date = dates.Key, Sum = dates.Sum() };