Mastering Source Generators
summary
Demonstrates a .NET source-generator pipeline that auto-creates auditable classes, Entity Framework configurations and DbSet entries from marked entities, plus an MSBuild task to emit non-C# artifacts. Uses a NetStandard2.0 analyzer project and favors incremental generators for caching so unchanged outputs aren’t regenerated, and reports performance: generated validation runs about 4× faster with roughly half the allocations compared to reflection. Includes reproducible demos and benchmarks such as a CSV credit-card validator and audit-history generators.
AI-written summary · about
chapters (9)
- 0:00Source Generators intro
- 6:02Custom Source Generator
- 13:10Incremental benefits
- 18:34Credit card validation
- 25:51Source Generators pros/cons
- 26:37File generation limits
- 28:50Supported targets and IDEs
- 30:35Data formats alternatives
- 32:45Summary & Q&A
related talks
33mSource Generators in Action
59mC# Source Generators - Write code that writes code
55mCode that writes code - .NET Source generators
52mCode that writes code - .NET Source generators
59mSource generators v2.0 — Incremental Generators
01h 02mUse your source code to document your application
37mThings I learned after a decade of writing code generators
51mGenerate You Some Code for Great Good
