3 ms·
https://github.com/dotnet/csharplang/issues/7009 https://github.com/dotnet/csharplang/issues/7009 [Proposal]: Interceptors #7009 > An interceptor is a method
by nh23423fefe 3y ago
https://github.com/dotnet/csharplang/issues/7009 https://github.com/dotnet/csharplang/issues/7009
[Proposal]: Interceptors #7009
> An interceptor is a method which can declaratively substitute a call to itself instead of a call to an interceptable method at compile time. This substitution occurs by having the interceptor declare the source locations of the calls that it intercepts. This provides a limited facility to change the semantics of existing code by adding new code to a compilation (e.g. in a source generator).
Sound like Spring AOP stuff without reading more
- zigzag312 3y agohttps://github.com/dotnet/roslyn/blob/main/docs/features/interceptors.md https://github.com/dotnet/roslyn/blob/main/docs/features/int... Without interceptors, source generators can only add new code, but cannot modify any existing code. Interceptors enable method call substitutions.