Right now the AttributedModelSourceGenerator doesn't do extra checks (e.g. return type checks) which means that it'll cause compilation errors if used incorrectly.
For example:
[Group("test")]
public class TestModule : Module
{
[Command("test")]
public void DoThing()
{ }
}
Will likely produce a class something like this:
internal class CommandFactory__TestModule__DoThing : ICommand
{
public async ValueTask<ICommandResult> ExecuteAsync(...)
{
var commandClass = new TestModule(...);
...
return await commandClass.DoThing();
...
}
}
Which, as you can imagine, won't work.
Right now the AttributedModelSourceGenerator doesn't do extra checks (e.g. return type checks) which means that it'll cause compilation errors if used incorrectly.
For example:
Will likely produce a class something like this:
Which, as you can imagine, won't work.