An interceptor observes or modifies an operation before it reaches an external system. In EF Core, a DbCommandInterceptor can capture generated SQL before it is sent to the data store. section 9.4.1
A practical SQL interceptor:
- Writes trimmed command text through ITestOutputHelper, keeping parallel test output associated with its test. section 9.4.1
- Returns a ValueTask because interception commonly performs synchronous SQL manipulation. section 9.4.1
Auditing generated SQL
A query for a book by ID produces parameterized SQL such as WHERE "b"."Id" = @__id_0. Logging this output provides an auditable record of what EF Core will execute. section 9.4.1

