I need help with a specific LINQ query (I still suck at em'!)
Background Info:
I've got a class DataEntry:
class DataEntry{
public Attribute Attribute{get; set;}
public List<object> Data{get; set;}
Attribute Class:
class Attribute{
public string FeatureName{get; set;}
public Types FeatureType{get; set;}
public List<object> PossibleValues{get; set;}
What i'll eventually have is about ~20 different data entries with about 1000 data objects per entry. What I'm trying to do is write a LINQ query to select a specific data entry based on the FeatureType and then give me a count of the total number of data items of that entry equal to a specific value.
What i'm trying to get is the count of the "high" and count of the "low" values from the data entry that has a featuretype equal to "foobar".
The closest I've gotten is:
int count = dataset.SelectMany(i => i.Data).Count(j => j.ToString() == "high");
Which gives me the count of "high", but doesn't filter by featuretype.
Is it possible? Is it possible to do in a single statement?