diff --git a/sample/Startup.cs b/sample/Startup.cs index 714db49..7179cf5 100644 --- a/sample/Startup.cs +++ b/sample/Startup.cs @@ -47,7 +47,7 @@ namespace SilkierQuartz.Example app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); - app.AddSilkierQuartzAuthentication(); + app.UseSilkierQuartzAuthentication() ; app.UseAuthorization(); app.UseSilkierQuartz( new SilkierQuartzOptions() diff --git a/src/SilkierQuartz/ApplicationBuilderExtensions.cs b/src/SilkierQuartz/ApplicationBuilderExtensions.cs index f514dd8..af3f336 100644 --- a/src/SilkierQuartz/ApplicationBuilderExtensions.cs +++ b/src/SilkierQuartz/ApplicationBuilderExtensions.cs @@ -167,10 +167,6 @@ namespace SilkierQuartz public static IServiceCollection AddSilkierQuartz(this IServiceCollection services, Action stdSchedulerFactoryOptions = null, Func> jobsasmlist = null) { - services.AddControllers() - .AddApplicationPart(Assembly.GetExecutingAssembly()) - .AddNewtonsoftJson(); - services.AddAuthentication(SilkierQuartzAuthenticateConfig.AuthScheme).AddCookie( SilkierQuartzAuthenticateConfig.AuthScheme, cfg => @@ -236,13 +232,12 @@ namespace SilkierQuartz /// /// The to add the middleware to. /// A reference to this instance after the operation has completed. - public static IApplicationBuilder AddSilkierQuartzAuthentication(this IApplicationBuilder app) + public static IApplicationBuilder UseSilkierQuartzAuthentication(this IApplicationBuilder app) { if (app == null) { throw new ArgumentNullException(nameof(app)); } - return app.UseMiddleware(); } }