Skip to content

Conversation

@bdovaz
Copy link
Contributor

@bdovaz bdovaz commented Oct 17, 2025

Partially fixes #1617

Add factories with IServiceProvider to all extension methods: AddJob, AddTrigger, ScheduleJob, and AddCalendar.

@sonarqubecloud
Copy link

@lahma
Copy link
Member

lahma commented Oct 18, 2025

I believe the ask was to have services.AddQuartz((quartz, serviceProvider) => ...); which is currently quite hard to achieve, how does this tackle this?

@bdovaz
Copy link
Contributor Author

bdovaz commented Oct 19, 2025

As you say, it doesn't completely solve the problem, but it does partially solve it and enables many use cases that were not possible until now.

I first tried to do what was requested, but as you said it required a major refactoring and I found it very complex.

I'm sure users will at least appreciate having these overloads.

In my case it unlocks many uses cases. Now, for example, if I want to add cron, I can read the expression with IOptions from a JSON file or an env.

Copy link
Member

@lahma lahma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for this specific use case, thank you for your contribution!

@lahma lahma merged commit c8db765 into quartznet:3.x Oct 26, 2025
6 of 7 checks passed
@lahma
Copy link
Member

lahma commented Oct 26, 2025

@bdovaz could you also create a PR against main the ensure these will be available there too?

@bdovaz
Copy link
Contributor Author

bdovaz commented Nov 13, 2025

@bdovaz could you also create a PR against main the ensure these will be available there too?

Done #2796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants