net_automatic_interface
net_automatic_interface copied to clipboard
Implement interface inheritance
When two classes inherit from each other, it would be nice if the interfaces did also.
[GenerateAutomaticInterface]
public class Parent : IParent
{
public void ParentMethod() { }
}
[GenerateAutomaticInterface]
public class Child : Parent, IChild
{
public void ChildMethod() { }
}
Would generate
public interface IParent
{
public void ParentMethod();
}
public interface IChild : IParent
{
public void ChildMethod();
}
I would be open to a PR but probably will not implement it myself
I achieve this by chaining my partial interfaces manually. It's minimal effort to achieve what you're looking to do and doesn't introduce a POLA violation.
public partial interface IParent;
public partial interface IChild : IParent;
[GenerateAutomaticInterface]
public class Parent : IParent
{
public void ParentMethod() { }
}
[GenerateAutomaticInterface]
public class Child : Parent, IChild
{
public void ChildMethod() { }
}