Table of Contents

Constructor QueryGuardSession

Namespace
QueryGuard
Assembly
QueryGuard.Core.dll

QueryGuardSession(string, QueryGuardPolicy, IQueryGuardRedactor?, Func<DateTimeOffset>?)

Initializes a new instance of the QueryGuardSession class.

public QueryGuardSession(string name, QueryGuardPolicy policy, IQueryGuardRedactor? redactor = null, Func<DateTimeOffset>? clock = null)

Parameters

name string

What this session measures: a route pattern such as GET /api/companies, or a test name.

policy QueryGuardPolicy

The policy this session will be evaluated against.

redactor IQueryGuardRedactor

Supplies the capture settings this session honours: whether a first-occurrence stack trace is wanted, and how such a trace is filtered. Defaults to a redactor with default options, which captures no stack traces at all.

clock Func<DateTimeOffset>

An optional wall-clock source, used to make timestamps deterministic in tests. Durations always come from a monotonic source regardless of this value.

Exceptions

ArgumentException

name is empty or whitespace.

ArgumentNullException

policy is null.