Skip to content

ksaicop/BuilderGenerator

Repository files navigation

C# Builder Generator

Build Status

C# Builder Generator is a able to generate Builder class from your code class.

Usage

Console

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

Web app

https://buildergenerator.azurewebsites.net/

Example

Input

public class ExampleClass
{
    public string Name { get; set; }
}

Output

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
        };
    }
}

Contributing

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.

License

MIT

  • How to use it

  • Version 1.0.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published