question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow custom configuration via Options pattern

See original GitHub issue

Is your feature request related to a problem? Please describe. “I’m always frustrated when” I cannot access IServiceProvider in the configure action of AddQuartz.

Describe the solution you’d like AddQuartz should have an overload like AddQuartz(this IServiceCollection serviceCollection, Action<IServiceProvider, IServiceCollectionQuartzConfigurator>? configure = null) similar to eg. AddContext.

Describe alternatives you’ve considered Alternatively Quartz could expose an options interface, and I could configure with eg. IConfigureOptions<QuartzOptions>. For example AddCors does this with CorsOptions. One can use IConfigureOptions<CorsOptions> to configure cors and access IServiceProvider.

As a workaround I can manually bootstrap the dependencies I’d like to access in AddQuartz.

Additional context My use cases are similar to Andrew Lock’s described in this blog post. Hope you find some inspiration there.

Many thanks!

EDIT: To be clear, this is a minor improvement on the configuration interface as feedback was requested.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ljanicommented, Oct 1, 2020

@lahma Looks great for my needs, thanks!

1reaction
lahmacommented, Sep 30, 2020

So I’ve done changes required to achieve @kevinchalet 's proposed idea with PR https://github.com/quartznet/quartznet/pull/978 . Hopefully this is nor more in line with expectations from options pattern and allows to do the Configure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options pattern in ASP.NET Core
The options pattern uses classes to provide strongly typed access to groups of related settings. When configuration settings are isolated by ...
Read more >
Option patterns with custom configuration provider in .NET
I was wondering how to write a custom configuration provider with IOptionsMonitor that means, some value will be loaded after a DI ...
Read more >
How to use the IOptions pattern for configuration in ASP. ...
In this post I demonstrate the power of the IOptions<> pattern for configuration in ASP.NET Core, and describe a few of the problems...
Read more >
ASP.NET Core - Accessing Configurations Using Options ...
In this article, you will learn how to use Options Pattern in ASP.NET Core to access configurations from the appsettings.json file.
Read more >
Options Pattern in ASP.NET Core - Bind & Validate ...
The Options pattern is a design pattern to manage and load configurations from the appsettings file in ASP.NET Core applications. It gives a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found