Cocona
Cocona copied to clipboard
Cocona.Command.Binder.CoconaParameterBinder does not support scoped services
Since Cocona.Command.Binder.CoconaParameterBinder injects the root IServiceProvider, using a FromServiceAttribute with a scoped service will fail
(Untested) Example:
var builder = CoconaApp.CreateBuilder(args);
builder.Services.AddScoped<IFoo, Foo>();
var app = builder.Build();
app.AddCommand("foo", ([FromService]IFoo foo) => {});
app.Run();