CodegenCS is a Toolkit for doing Code Generation using plain C#

published on 2022/09/12

By using plain C# we can render our outputs using plain strings (and string interpolation) and using well-established and well-known C# constructs (invoking methods, passing parameters, embedding strings, looping, formatting, etc) - no need to learn a new syntax.

On top of that our templates can leverage .NET Framework and .NET libraries (e.g. read input models from JSON file, read the schema directly from a database, read YAML specs of a REST API, etc).

CodegenCS is written in C# and templates are developed using plain C# - but the templates can write any text-based output (you can write C#, Java, Javascript, Python, HTML, SQL Scripts, CSHTML, XML, Terraform files, or anything else).

GitHub

This looks like a promising code generation toolkit. Code generation, when used properly, can really boost productivity.