DI020
Middleware Captures Scoped Service In Constructor
Scoped services captured by the constructor of a conventional middleware class — both directly (a scoped parameter) and transitively (a parameter whose activation graph reaches a scoped service). Middleware registrations are recognized in reduced extension form (app.UseMiddleware<T>()) and in direct framework static form (UseMiddlewareExtensions.UseMiddleware<T>(app) / UseMiddlewareExtensions.UseMiddleware(app, typeof(T))), with explicit activation arguments matched to constructor parameters. A stable local reference-type array (such as object[] or string[]) initialized by a fixed array creation is expanded positionally just like the framework's params object[] call; reassigned, external, uninitialized, and otherwise dynamic arrays remain unproven and silent. The adversarial boundary is recorded in docs/adversarial/DI020.md.
Warning Default severity · Code fix: No