NCronJob
NCronJob copied to clipboard
[V5] Align dynamic and typed job creation
Currently registering those two kind of jobs is done through very different interfaces
builder.AddJob<SampleJob>(p => p.WithCronExpression("* * * * *").WithName("MyName"));
vs
builder.Services.AddNCronJob(b => b.AddJob(() => {}, "* * * * *", "MyName"));
This is somewhat unexpected.
Deploy the fluent builder interface to dynamic jobs
Related https://github.com/NCronJob-Dev/NCronJob/issues/221#issuecomment-2712836821
That was to some extent on purpose: The reason is that we wanted to be in line with the Minimal
API:
app.MapGet("/", () => ...);
I am fine as long as we keep both versions, because I want to have a minimal step to overcome when using the lib