Yet another source generator that creates interfaces for implementations and auto-implements the said interface.
public class MyService
{
public void HelloWorld()
}
[AutoInterface]
public partial class MyService
{
public void HelloWorld()
}
IMyService service = new MyService();
Source generator will scan the project for partial classes with [AutoInterfaceAttribute]
Found classes will be analyzed for public methods, generic arguments and generic argument constrains
For matching types there will be generated 2 components:
- An interface with the classes name
- A partial class implementing your interface
- public methods
- methods with parameter modifiers
- generic class arguments
- generic class type constrains
- generic method arguments
- generic method type constraints
- docs
- explicit interface name, namespace
- nullable parameters
- probably a bunch more
A: Probably not but in some cases it would help.