Skip to content
Cy Scott edited this page Aug 22, 2021 · 3 revisions

MGen is a code generator library that can generate C# classes from interfaces. 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.

Clone this wiki locally