Writing Code with Code: Getting Started with the Roslyn APIs
summary
Shows how the Roslyn APIs are used to generate a full .NET client from a JSON schema: parse a TypeScript spec with TS‑morph into a normalized JSON schema, then build C# syntax trees with SyntaxFactory, call normalize whitespace and emit thousands of .cs files in seconds. Covers handling unions/polymorphism, query-string parameter classes, constructor selection, and serialization attributes, and reports a working generator covering ~80% of endpoints for an API that has ~420 endpoints and 4,000 data structures.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 0:51Agenda
- 1:41Roslyn
- 2:30What is Roslyn
- 5:08What are analyzers
- 6:36analyzers in action
- 8:26Source generators
- 11:53Compiler pipeline
- 14:05Syntax trees
- 17:47Visual Studio
- 18:32Syntax Tree Demo
- 22:15Elastic Search
- 27:34Demo
- 35:31Practicalities
- 43:42Code Generation Pipeline
- 46:38Json Schema
- 51:53Generator Code
- 55:10Refactoring
- 59:03Resources
related talks
01h 16mAutomate yourself out of a job with Roslyn
01h 00mAutomate Yourself Out of a Job with Roslyn
01h 02mUse your source code to document your application
55mCode that writes code - .NET Source generators
01h 08mAnalyzing source code using Roslyn
52mCode that writes code - .NET Source generators
59mC# Source Generators - Write code that writes code
01h 00mUse your source code to document your application
