LINQ query expression question

Soldato
Joined
13 Dec 2002
Posts
7,646
Location
Manchester City Centre
I currently have the following code
Code:
var issues = (from b in site.Blocks where b.Rooms.Any(r => r.Issues.Any(i => !i.Closed))select b).Count();
What I want to retrieve is the count of all issues within site which are not closed.

The structure is:
site 1-* Blocks 1-* Rooms 1-* Issues

I think what I have at the moment would return the count of blocks which have an open issue. Any ideas if it's possible to do what I want within one expression, I can't get my head around it :(

Any help much appreciated
 
it would appear I am something of a tit, the obvious solution is to go from the issues table upwards rather than site down, it may be less economical but it's much simpler
 
Back
Top Bottom