captive dependency
A long-lived object holding on to a short-lived one, so it outlives its time.
A captive dependency occurs when a longer-lived service (a singleton) depends on a shorter-lived one (scoped or transient), extending that dependency's lifetime; scope validation reports it.
Examples
A singleton cache that takes a scoped
DbContextin its constructor keeps that one context for the life of the app.
See also