File tree Expand file tree Collapse file tree 4 files changed +21
-4
lines changed
src/Hangfire.RecurringJobExtensions
test/Hangfire.RecurringJobExtensions.Tests Expand file tree Collapse file tree 4 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "dependencies" : {
3- "Hangfire.RecurringJobExtensions" : " 1.1.0 -*" ,
3+ "Hangfire.RecurringJobExtensions" : " 1.1.2 -*" ,
44 "Hangfire.Console" : " 1.1.5" ,
55 "Hangfire.AspNetCore" : " 1.6.7" ,
66 "Hangfire.Core" : " 1.6.7" ,
Original file line number Diff line number Diff line change @@ -75,5 +75,22 @@ public static IGlobalConfiguration UseRecurringJob(this IGlobalConfiguration con
7575
7676 return configuration ;
7777 }
78+
79+ /// <summary>
80+ /// Build <see cref="RecurringJob"/> automatically with <seealso cref="IConfigurationProvider"/>.
81+ /// </summary>
82+ /// <param name="configuration"><see cref="IGlobalConfiguration"/>.</param>
83+ /// <param name="provider"><see cref="IConfigurationProvider"/></param>
84+ /// <returns><see cref="IGlobalConfiguration"/>.</returns>
85+ public static IGlobalConfiguration UseRecurringJob ( this IGlobalConfiguration configuration , IConfigurationProvider provider )
86+ {
87+ if ( provider == null ) throw new ArgumentNullException ( nameof ( provider ) ) ;
88+
89+ IRecurringJobBuilder builder = new RecurringJobBuilder ( new RecurringJobRegistry ( ) ) ;
90+
91+ builder . Build ( ( ) => provider . Load ( ) ) ;
92+
93+ return configuration ;
94+ }
7895 }
7996}
Original file line number Diff line number Diff line change 11{
2- "version" : " 1.1.0 -*" ,
2+ "version" : " 1.1.2 -*" ,
33 "title" : " Hangfire.RecurringJobExtensions" ,
44 "description" : " Hangfire extensions for RecurringJob" ,
55 "authors" : [ " icsharp" ],
2323 },
2424
2525 "dependencies" : {
26- "Hangfire.Core" : " 1.6.7 "
26+ "Hangfire.Core" : " 1.6.0 "
2727 },
2828
2929 "frameworks" : {
Original file line number Diff line number Diff line change 55 "xunit" : " 2.2.0-*" ,
66 "dotnet-test-xunit" : " 2.2.0-*" ,
77 "Moq" : " 4.6.38-alpha" ,
8- "Hangfire.RecurringJobExtensions" : " 1.1.0 -*"
8+ "Hangfire.RecurringJobExtensions" : " 1.1.2 -*"
99 },
1010
1111 "frameworks" : {
You can’t perform that action at this time.
0 commit comments