Skip to content

CyAScott/MGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MGen MGen

NuGet Badge

MGen is a code generator library that can generate C# classes from interfaces.

Simple Exmaple

The first thing you will need to do is to install the MGen NuGet packages.

Install-Package MGen
Install-Package MGen.Abstractions

Here is a simple example of how it works:

[Generate]
public interface IHaveAnGuidId
{
    Guid Id { get; set; }
}

The generated code will look like:

public class HaveAnGuidIdModel : IHaveAnGuidId
{
    public System.Guid Id
    {
        get
        {
            return _Id;
        }
        set
        {
            _Id = value;
        }
    }
    private System.Guid _Id;
        
    public HaveAnGuidIdModel()
    {
    }
        
}

For a full list of supported features read this.

Icon Created By

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 B

About

A C# model generator based on code generators for .Net

Resources

License

Stars

Watchers

Forks