Skip to content

ashotjanibekyan/EmptyConstructor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Empty constructor generator

A simple C# source generator that generates an empty constructor for a class if it is marked with the EmptyConstructor.EmptyConstructorAttribute attribute.

using EmptyConstructor;

[EmptyConstructor]
public partial class ClassName()
{
    private string _name { get; set;}
    public ClassName(string name)
    {
        this._name = name;
    }
}

Generates

using EmptyConstructor;

partial class ClassName()
{
    public ClassName()
    {
    }
}

It does nothing if the class already has an empty constructor.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages