Path: redb/redb.Examples/Examples/E060_DictContainsKey.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Examples/Examples/E060_DictContainsKey.cs ---- using System.Diagnostics; using redb.Core; using redb.Examples.Models; using redb.Examples.Output; namespace redb.Examples.Examples; /// /// Query employees using Dictionary.ContainsKey. /// Find employees who have a desk phone. /// [ExampleMeta("E060", "Dict ContainsKey - Phone Directory", "Query", ExampleTier.Free, 2, "Dictionary", "ContainsKey", "Pro")] public class E060_DictContainsKey : ExampleBase { public override async Task RunAsync(IRedbService redb) { var sw = Stopwatch.StartNew(); // Pro: Query dictionary with ContainsKey var query = redb.Query() .Where(e => e.PhoneDirectory!.ContainsKey("desk")) .Take(100); // Uncomment to see generated SQL: // var sql = await query.ToSqlStringAsync(); // Console.WriteLine(sql); var result = await query.ToListAsync(); sw.Stop(); return Ok("E060", "Dict ContainsKey - Phone Directory", ExampleTier.Free, sw.ElapsedMilliseconds, result.Count, [$"Filter: PhoneDirectory.ContainsKey('desk')"]); } }