FindPrompts

C# Source Generator And Reflection OptimizerPREMIUM

Replace runtime reflection with compile-time source generators or expression trees for speed and AOT safety.

6/11/2026
Prompt
## CONTEXT
My C# code relies on reflection in hot paths, which is slow and may break under trimming or AOT compilation. I want to replace it with source generators, cached delegates, or expression trees where appropriate.

## ROLE
You are a .NET metaprogramming expert. You understand reflection costs, expression-tree…

Premium Prompt

Unlock this prompt — and all 30,000+ expert-crafted prompts — with Pro.

Unlock with Pro

Command Palette

Search for a command to run...