Closed jeremydmiller closed 3 months ago
I can imagine that it's a big amount of work, but ever considered leaning more onto the IOptions
stuff for WolverineOptions
?
The IWolverineExtension
interface seems extremely similar to IConfigureOptions
from IOptions
.
(Similar thing in Marten with IConfigureMarten
)
Also for example the app.MapWolverineEndpoints(config => { /* Do something with the config */ });
feels a bit out of place.
More "in line with .NET stuff" would be a pair of services.AddWolverineEndpoints(config => ...)
and app.MapWolverineEndpoints()
methods.
I'd call the first a very low priority. A lot of Wolverine is descended from an older (failed) framework and was put in place long before stuff like IOptions got into .NET.
As for the 2nd, I don't have a huge opinion, but an Add
syntax instead of Map
is fine. I did that mostly to be consistent with Minimal API. I don't want both the services.AddWolverineEndpoints() and app.MapWolverineEndpoints() though. I loathe that clumsiness with .NET web application setup. Guess we'll have to when Lamar goes away though. Bleck.
Just got another idea: Maybe with 3.0 we can also change DocumentAttribute.Required
to be true
by default - I think that's more intuitive.
I'm closing this discussion for now. @haefele If you'd like, open a new issue for the [Document] thing? I'm not that enthusiastic, but let's see if anyone else has opinions
Long story short, I think this suddenly became a much higher priority issue for me due to some problems at a JasperFx client. The migration from 2.0 to 3.0 should be as easy as possible
The major arching proposed changes:
IServiceCollection.AddWolverine()
bootstrapping mechanism. It's absolutely vital that Wolverine can be used with bootstrappers other thanIHostBuilder
as this is holding Wolverine back quite a bitEndpoint
API that's grown