C# Builder Generator is a able to generate Builder class from your code class.
Run 'BuilderGenerator.Console.exe path/to/file/with/class/declaration/ClassName.cs' As a result new file ClassNameBuilder.cs will be created next to ClassName.cs
https://buildergenerator.azurewebsites.net/
public class ExampleClass
{
public string Name { get; set; }
}
public class ExampleClassBuilder
{
private string _name;
public ExampleClassBuilder()
{
_name = "name";
}
public ExampleClassBuilder WithName(string name)
{
_name = name;
return this;
}
public ExampleClass Build()
{
return new ExampleClass()
{
Name = _name
};
}
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
-
How to use it
-
Version 1.0.0