Innovabit.DotNet.Interceptors.Abstractions
1.0.0.100
See the version list below for details.
dotnet add package Innovabit.DotNet.Interceptors.Abstractions --version 1.0.0.100
NuGet\Install-Package Innovabit.DotNet.Interceptors.Abstractions -Version 1.0.0.100
<PackageReference Include="Innovabit.DotNet.Interceptors.Abstractions" Version="1.0.0.100" />
<PackageVersion Include="Innovabit.DotNet.Interceptors.Abstractions" Version="1.0.0.100" />
<PackageReference Include="Innovabit.DotNet.Interceptors.Abstractions" />
paket add Innovabit.DotNet.Interceptors.Abstractions --version 1.0.0.100
#r "nuget: Innovabit.DotNet.Interceptors.Abstractions, 1.0.0.100"
#:package Innovabit.DotNet.Interceptors.Abstractions@1.0.0.100
#addin nuget:?package=Innovabit.DotNet.Interceptors.Abstractions&version=1.0.0.100
#tool nuget:?package=Innovabit.DotNet.Interceptors.Abstractions&version=1.0.0.100
Innovabit.DotNet.Interceptors.Abstractions
Core building blocks for aspect-oriented programming (AOP) in .NET using
Castle DynamicProxy and
Microsoft.Extensions.DependencyInjection. This is the base package every other
Innovabit.DotNet.Interceptors.* package builds on (logging, validation,
notifications, retry, ...).
What it provides
InterceptorBase— the abstract base for an interceptor (sync,Task/Task<T>andValueTask/ValueTask<T>aware).AddInterceptors()/InterceptorBuilder— register the proxy generator and your interceptors.Add*WithInterception/TryAdd*WithInterception— register a service so its interface is proxied and intercepted. The concrete implementation is kept under a private key, so it can't be resolved — and its interception bypassed — by accident.Add*ClassWithInterception/TryAdd*ClassWithInterception— proxy a service that has no interface (class proxy; onlyvirtualmembers are intercepted).- An ordered, multi-interceptor pipeline:
InterceptorBase.Order,InterceptorOrders(recommended scale) andInterceptorOrderOptions(per-registration overrides). - A bundled Roslyn analyzer that flags interceptor attributes with no effect at compile time —
INTX001(attribute on astaticmethod) andINTX002(a parameter attribute such as[DoNotLog]on a method that isn't intercepted).
Install
dotnet add package Innovabit.DotNet.Interceptors.Abstractions
Usage
using Innovabit.DotNet.Interceptors;
public sealed class TracingInterceptor : InterceptorBase
{
public override bool CanIntercept(IInvocation invocation) => true;
public override void ProcessInterceptionSync(IInvocation invocation) => invocation.Proceed();
public override Task ProcessInterceptionAsync(IInvocation invocation) { invocation.Proceed(); return (Task)invocation.ReturnValue!; }
public override Task<TResult> ProcessInterceptionAsync<TResult>(IInvocation invocation) { invocation.Proceed(); return (Task<TResult>)invocation.ReturnValue!; }
}
services.AddInterceptors()
.Register<TracingInterceptor>(); // or Register<T>(order) to place it in the pipeline
// Proxy IMyService so registered interceptors wrap MyService. Anything that depends on
// IMyService — even services registered without interception — receives the proxied instance.
services.AddScopedWithInterception<IMyService, MyService>();
// No interface? Use a class proxy (only virtual members are intercepted; the class must be non-sealed).
services.AddScopedClassWithInterception<MyService>();
The un-proxied
MyServiceis registered under a private key, so consumers must depend onIMyService(or, for class proxies,MyServiceitself) and always get the intercepted instance — there is no publicly resolvable concrete to inject and silently skip the pipeline.
Pipeline order
When several interceptors are registered they run as a pipeline. InterceptorBase.Order
controls position: lower runs first (outermost); higher runs closer to the intercepted
method. Ties keep registration order. Override per registration with
Register<T>(int order) or SetOrder<T>(int order). See InterceptorOrders for the
recommended scale.
Part of
The Innovabit.DotNet.Interceptors suite —
github.com/Innovabit/dotnet-interceptors.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Castle.Core (>= 5.2.1)
- Castle.Core.AsyncInterceptor (>= 2.1.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
-
net8.0
- Castle.Core (>= 5.2.1)
- Castle.Core.AsyncInterceptor (>= 2.1.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
-
net9.0
- Castle.Core (>= 5.2.1)
- Castle.Core.AsyncInterceptor (>= 2.1.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
NuGet packages (15)
Showing the top 5 NuGet packages that depend on Innovabit.DotNet.Interceptors.Abstractions:
| Package | Downloads |
|---|---|
|
Innovabit.DotNet.Interceptors.Logging.Abstractions
Base package for logging using interceptor. |
|
|
Innovabit.DotNet.Interceptors.Collections
Package for some useful interceptors like retry on exception. |
|
|
Innovabit.DotNet.Interceptors.Notifications.Abstractions
Base package for sending notifications when an intercepted method throws an exception. |
|
|
Innovabit.DotNet.Interceptors.Validation.Abstractions
Package for data validation using interceptor. |
|
|
Innovabit.DotNet.Interceptors.Caching.Abstractions
Base package for method result caching using interceptors. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.119 | 118 | 11/14/2026 |
| 2.0.118 | 806 | 11/7/2026 |
| 2.0.117 | 818 | 10/31/2026 |
| 2.0.116 | 768 | 10/26/2026 |
| 2.0.115 | 749 | 10/17/2026 |
| 2.0.114 | 724 | 10/10/2026 |
| 2.0.113 | 762 | 10/3/2026 |
| 2.0.112 | 722 | 9/28/2026 |
| 2.0.111 | 688 | 9/28/2026 |
| 2.0.110 | 702 | 9/27/2026 |
| 2.0.109 | 719 | 9/26/2026 |
| 2.0.108 | 698 | 9/26/2026 |
| 2.0.107 | 763 | 9/26/2026 |
| 2.0.106 | 574 | 9/25/2026 |
| 2.0.105 | 705 | 9/25/2026 |
| 1.0.0.104 | 669 | 9/25/2026 |
| 1.0.0.103 | 542 | 9/25/2026 |
| 1.0.0.102 | 412 | 9/25/2026 |
| 1.0.0.101 | 401 | 9/25/2026 |
| 1.0.0.100 | 402 | 9/25/2026 |