mercredi 28 août 2019

AOP Interceptor feature with .NET Core

The Dependency Injection provider of .NETCore, out-of-the-box, doesn't provide Interceptors, as we can find in other DI frameworks as Unity or Spring.


I'm talking about intercept calls to methods not at Controllers levels, something we can do with Filters, Middlewares, etc, but for any service registered in the IServiceCollection, for that there is nothing available.

Using some techniques and based in a solid framework as Castle Windsor and DynamicProxy feature we can implement Interceptors for any class implementing an interface.

Nuget package: Castle.Core

Aucun commentaire:

Enregistrer un commentaire