Table of Contents

Constructor QueryRecord

Namespace
QueryGuard
Assembly
QueryGuard.Core.dll

QueryRecord(int, QueryCommandKind, QueryFingerprint, TimeSpan, DateTimeOffset, string?, int, bool, string?, IReadOnlyList<string>?, string?)

Initializes a new instance of the QueryRecord class.

public QueryRecord(int sequence, QueryCommandKind kind, QueryFingerprint fingerprint, TimeSpan duration, DateTimeOffset startedAt, string? commandSource = null, int parameterCount = 0, bool isFailed = false, string? failureType = null, IReadOnlyList<string>? tags = null, string? stackTrace = null)

Parameters

sequence int

The one-based position of this command within its session.

kind QueryCommandKind

The kind of relational command.

fingerprint QueryFingerprint

The fingerprint of the normalized command text.

duration TimeSpan

How long the command took to execute.

startedAt DateTimeOffset

When the command started, in UTC.

commandSource string

The EF Core command source, for example Linq or SaveChanges, or null when the provider did not report one.

parameterCount int

How many parameters the command declared.

isFailed bool

Whether the command completed by failing.

failureType string

The exception type name when isFailed is true. The exception itself is never captured, and never replaces the one the application sees.

tags IReadOnlyList<string>

Query tags recognized on the command, if any.

stackTrace string

A filtered stack trace for the first occurrence of this fingerprint, when capture is enabled.

Exceptions

ArgumentOutOfRangeException

sequence is less than one.

ArgumentNullException

fingerprint is null.