first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

LINQ to Objects: Querying a Generic Dictionary Collection

/* using System; using System.Linq; using System.Collections.Generic; */

Dictionary<String,Boolean> tests = new Dictionary<string,bool> { { "one", true }, { "two", false }, { "three", true }, { "four", false }, { "five", true }, { "six", true } };

var testData = from t in tests

where t.Value == false

select t;

foreach ( var item in testData ) { Console.WriteLine( item.Key ); }

/* Output:

    two
    four

*/

mod date: 2008-04-05T03:02:18.000Z