4 ms·
The new interceptors in C# 12 look pretty wild. Will have to play around with them. Was hoping for more of a PostSharp style AOP framework, and this doesn't a
by rjbwork 3y ago
The new interceptors in C# 12 look pretty wild. Will have to play around with them. Was hoping for more of a PostSharp style AOP framework, and this doesn't appear to be that.
- owlstuffing 3y agoYeah, interceptors via source generators is hardcore power. Reminds me of project Manifold[1], the work they are doing is amazing eg. in-line type-safe SQL, GraphQL, etc. Mind bending, beyond next generation level stuff. 1. https://github.com/manifold-systems/manifold https://github.com/manifold-systems/manifold
- SideburnsOfDoom 3y agoIt seems though that you're not going to use interceptors to code up your business logic, or at least not without producing unsuitable code. What they're likely aimed at is scenarios such as DI frameworks where there is currently "serious magic" code that generates code at runtime using reflection and lightweight code gen; and in new AOT scenarios all of this has to be done ahead of time, during compilation, in source generators, without runtime reflection. In other words, if you're not writing such an DI / AOP library, it's not for you. But if you want to make a "PostSharp style AOP framework" then this is a tool for you to use when building it.