Vogen Configuration - stevedunn/vogen

Vogen Configuration

Vogen is a code generation library for .NET that uses source generators to generate boilerplate code. The library provides a fluent configuration API to customize the generated code. This document covers the possible options and provides examples for each option.

Configuration

The VogenConfiguration class is used to configure the code generation process. The configuration can be set up in the following ways:

Default Configuration

By default, Vogen uses the VogenDefaultsAttribute to set up the default configuration. The attribute can be applied to any class or method to set the default configuration for the generated code.

Example:

[VogenDefaults(
Namespace = "MyCompany.MyProject",
ClassName = "MyClass",
RecordName = "MyRecord",
UseRecordTypes = true)]
public class MyClass
{
// ...
}

Configuring with Code

The VogenConfiguration class can be used to configure the code generation process. The configuration can be set up in the following way:

Example:

var configuration = new VogenConfiguration
{
Namespace = "MyCompany.MyProject",