I am trying to find the corerct LINQ to SQL query operator and predicate combo that can operate on an audit table.
Imagine a table called Setting that has three columns : rowID, DefID, and Value.
I want to be able to check that every DefID ( in this case all definition 1 through 3 ) has at least one row which has a value set to true.
the LINQ expression should return a bool true or false. For example,
RowID DefID Value
1 1 true
2 2 false
3 3 true
LINQ returns false because DefID = 2 does not have any value = true
RowID DefID Value
1 1 true
2 2 false
3 2 true
returns false because defid 3 is missing
RowID DefID Value
1 1 true
2 1 false
3 2 true
4 3 true
returns true because ALL definitions have at least one value = true