Skip to content

Method Support

Cy Scott edited this page Aug 23, 2021 · 2 revisions

Interfaces that have method members will have the method implemented, unless the interface is marked a partial (i.e. public partial interface IHaveAMethod {}). The method implementation will throw the NotImplementedException exception. Here is a simple example of how it works:

[Generate]
public interface IHaveAMethod
{
    void Test();
}

The generated code will look like:

public class HaveAMethodModel : IHaveAMethod
{
    public void Test()
    {
        throw new System.NotImplementedException();
    }
        
    public HaveAMethodModel()
    {
    }
        
}

Clone this wiki locally