Path: redb/redb.Examples/Examples/E016_WhereChain.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/E016_WhereChain.cs ---- using System.Diagnostics; using redb.Core; using redb.Examples.Models; using redb.Examples.Output; namespace redb.Examples.Examples; /// /// Filter employees using chained Where() calls. /// Each Where() adds another condition. /// [ExampleMeta("E016", "Where - Chained Filters", "Query", ExampleTier.Free, 2, "Where", "Chain")] public class E016_WhereChain : ExampleBase { public override async Task RunAsync(IRedbService redb) { var sw = Stopwatch.StartNew(); // Chained Where() calls - equivalent to AND var query = redb.Query() .Where(e => e.Age >= 30) .Where(e => e.Salary > 60000m) .Where(e => e.Department != "Support") .Take(100); // Uncomment to see generated SQL: // var sql = await query.ToSqlStringAsync(); // Console.WriteLine(sql); var result = await query.ToListAsync(); sw.Stop(); return Ok("E016", "Where - Chained Filters", ExampleTier.Free, sw.ElapsedMilliseconds, result.Count, [$"Filter: .Where(Age).Where(Salary).Where(Dept)"]); } }