So i got this code:
ClassA { List<ClassB> classBList;}
ClassB { List<ClassC> classCList;}
ClassC { String ID;}
Dictionary<string,int> dict;
ClassA MyObject;
The keys on the dictionary should match the the ID field on ClassC And i wanna do the following query on linq
List<String> matches = (from b in MyObject
from c in b.classCList
join d in dict
on c.ID equals dict.Key
select new
{
c.Value == 0 ? "YES" : "NO"
}).ToList();
But I'm getting the error: "Invalid anonymous type member ..."
The bottomline is ... how can i have a condition within the select new?
EDIT
How can i do this query with extended methods?
Any help? Ty