use-interceptors-and-dynamic-proxy
Installation
SKILL.md
Using Interceptors and Dynamic Proxies
ABP attaches IAbpInterceptor implementations while services are registered, then the Autofac/Castle integration creates either an interface proxy or a class proxy. The call must cross that proxy for an interceptor to run.
When to Use
- Diagnose why validation,
[UnitOfWork],[Authorize],[Audited], or[RequiresFeature]is not taking effect on a service call. - Add reusable before/after behavior around application or domain services.
- Select services for interception through
IServiceCollection.OnRegistered. - Inspect the invoked method, arguments, target, or return value through
IAbpMethodInvocation.
When Not to Use
- Module lifecycle and ordinary registrations — use define-application-modules.
- Audit-log storage, contributors, and entity history — use configure-audit-logging.
- Feature definitions and values — use manage-settings-and-features.
- Service exposure, replacement, keyed services, or decoration — use register-and-replace-services.