[Interceptor]: intercept "Method(()=> myvariable)" before the compiler generates closure #71408
Unanswered
netcorefan1
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello to all,
I'm able to use an interceptor like this:
The main problem is that the compiler comes first of my intercepted call and cause the generation of a closure.
I'm experimenting with source generators + interceptors in order to avoid closures automatically without recurring to a wrapper function like
LambaFactory.New(param, (injectedParam) => { ... });
.In C# 12 preview features article I read this:
ASP.NET Minimal API calls like app.MapGet("/products", handler: (int? page, int? pageLength, MyDb db) => { ... }) can be intercepted to register a statically-generated thunk which calls the user’s handler directly, skipping an allocation and indirection.
Not sure If I have understood well, to me seems exactly what I'm trying to do, but I'm very confused on where I should start on.
Any help would be appreciated!
Thanks
Beta Was this translation helpful? Give feedback.
All reactions