NCronJob icon indicating copy to clipboard operation
NCronJob copied to clipboard

[V5] Align dynamic and typed job creation

Open nulltoken opened this issue 10 months ago • 2 comments

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.

nulltoken avatar Feb 27 '25 20:02 nulltoken

Deploy the fluent builder interface to dynamic jobs

Related https://github.com/NCronJob-Dev/NCronJob/issues/221#issuecomment-2712836821

nulltoken avatar Mar 11 '25 20:03 nulltoken

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

linkdotnet avatar Jul 08 '25 19:07 linkdotnet