Slide 5
Slide 5 text
Code-Generierung in .NET
Roslyn Source Generators
T4-Templates
• Generation of new files out of static source files, like XML/CSV/JSON, on demand
• Prominent example: Generation of entities in Entity Framework (non-Core) 6
• Pros:
• Code generation at development time : easy to review
• Generated types can be used during development directly
• Cons:
• No built-in means to analyze the current .NET code
• No means to analyze the current state of the application
• Doesn‘t react to changes in source files automatically
• Virtually bound to MS Visual Studio. JetBrains Rider requires some hacks and workarounds to work
properly.
Code generation today
development time compile time run time
T4