Table of Contents

Method Extract

Namespace
QueryGuard
Assembly
QueryGuard.Core.dll

Extract(string?)

Extracts every QueryGuard directive from a command's leading comments.

public static IReadOnlyList<string>? Extract(string? commandText)

Parameters

commandText string

The command text, which may be null.

Returns

IReadOnlyList<string>

The directives found, or null when there are none, which is the common case and avoids allocating an empty collection per command.

Remarks

Only line comments are scanned, because that is what TagWith produces. Scanning stops at the first line that is neither blank nor a comment: a directive belongs at the top of the statement, and reading the whole statement on every command would be work done for nothing.