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
namestringWhat this session measures: a route pattern such as
GET /api/companies, or a test name.policyQueryGuardPolicyThe policy this session will be evaluated against.
redactorIQueryGuardRedactorSupplies 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.
clockFunc<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
nameis empty or whitespace.- ArgumentNullException
policyis null.