3 ms·
Interceptors (new C# metaprogramming feature) to fuel DapperAOT development
- zigzag312 3y agoI've rewritten the title to be more informative. Key point IMHO is a new metaprogramming feature that enables development of a more elegant DapperAOT version. Original title, I think, is a bit too generic project status update: Announcement/Input - DapperAOT progress and Dapper API / feature update English is not my native language, so I'm not sure it's a good title for HN. Any suggestion to improve it are welcome.
- shortrounddev2 3y agoI'm having trouble finding any information from MS on interceptors. Can you link something about them?
- nh23423fefe 3y agohttps://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.