score:1

You can do:

var competitions = new Competition(); // Populated competition class

var results = (from c in competitions
               from e in c.ChildEvents
               from ri in e.ResultInfos
               where ri.Season == 2013).ToList();

It's unclear why you need an additional where but you could extend it and have another clause such as

where ri.Season == 2013 && EventName == "Event"

As @von.v has pointed out, you can access ResultInfos directly via the Competition class, so you can simplify it via:

   var results = (from c in competitions
                  from ri in c.ResultInfos
                  where ri.Season == 2013).ToList();

score:0

I don't undersant what do you want ? If you want the competition which have events with results infos in 2013 and result infos also in 2013 you can do this :

model.Where(c => c.ChildEvents
                  .SelectMany(ce => ce.ResultInfos)
                  .Where(ri => ri.Season == 2013).Count() > 0
            &&
            c.ResultInfos.Where(ri => ri.Season == 2013).Count() > 0)
     .ToList();

But I'm not sure that I undersand what you need


Related Articles