Relatude Help

Queries are immutable

As in LINQ, every operator returns a new query and leaves the original unchanged. You can keep a base query, share it between threads and branch from it:

var published = db.Query<IEvent>().Where(e => e.Status == EventStatus.Published);

var upcoming = published.Where(e => e.StartsUtc > DateTime.UtcNow);   // a new query
var total    = published.Count();                                     // 'published' is unchanged

So q.Where(...) on a line of its own does nothing: write q = q.Where(...). The operators are marked [Pure], so code analysis rule CA1806 flags a discarded result (make it a warning with dotnet_diagnostic.CA1806.severity = warning in .editorconfig). The facet, pivot, group and search builders work the same way.