Home
Larry's C# Musings' Friends
 
[Most Recent Entries] [Calendar View] [Friends View]

Below are the most recent 1 friends' journal entries.

    Saturday, December 12th, 2009
    csharp
    [ sparkymark ]
    1:59a
    LINQ beginner
    I have a pair of LINQ "group" statements, each outputs a IEnumerable<IGrouping<bool,int>>. Call these results a and b. I want to create four collections of ints, The ones that correspond to "a.Key && b.Key", "a.Key && !b.Key", "!a.Key && b.Key", "!a.Key && !b.Key".

    I can convert a and b to Dictionaries with the ToDictionary extension method and have code like...

    var foo = from aa in aMap[true] join bb in bMap[true] on aa equals bb select aa;

    ...but then I need to check the dictionary keys exists, which is not a huge overhead but I can't help thinking there must be some way of "join"ing a and b directly...?
C # For You   About LiveJournal.com

Advertisement