Closed dahlbyk closed 3 years ago
PR has been updated onto latest master
Version 1.0.5 should be available shortly on NuGet with the changes. Thanks for contributing!
@dahlbyk, thanks to your example of configuring HangFire above, I was able to overhaul my implementation and reduce it down to 1/5th of what it was and remove all the weird hacks I had to put in when I first implemented this library. Now, I'm basically word-for-word as far as code is concerned with what I would do in an ASP.NET Core application. Thanks!
@dahlbyk, can I get your thoughts on #5?
I've finally started using this in the project I mentioned in #1, and ran into an issue wiring up Hangfire.NetCore to use DI for job activation. Specifically,
services.AddHangfire(...)
doesn't execute custom configuration until anIGlobalConfiguration
is resolved. This is verified for full ASP.NET Core, but I had to figure that out the hard way.Anyway, to fix this I needed access to the
IServiceProvider
, which wasn't exposed anywhere. To that end, this PR includes two important changes:IServiceProvider
and methods to work with it have moved fromprivate
inServiceScopeModule
topublic
inStartupApplication
IServiceProvider
is now automatically built beforeConfigure(IAppBuilder)
, as also happens in the ASP.NET Core hosting lifecycle.ConfigureServices()
as[Obsolete]
.I also included a few bonus changes, including:
.editorconfig
to enforce non-VS-default code standards (K&R braces,using
order)DependencyResolver
now happens inAddControllers()
, as the resolver is useless if the controllers haven't been registered.For reference, this is an abbreviated version of what my
Hangfire.NetCore
config now looks like: