Closed iMuhammadMustafa closed 2 years ago
public void ConfigureServices(IServiceCollection services)
{
services.AddSilkierQuartz(options =>
{
options.VirtualPathRoot = "/quartz";
options.UseLocalTime = true;
options.DefaultDateFormat = "yyyy-MM-dd";
options.DefaultTimeFormat = "HH:mm:ss";
options.CronExpressionOptions = new CronExpressionDescriptor.Options()
{
DayOfWeekStartIndexZero = false //Quartz uses 1-7 as the range
};
}
#if ENABLE_AUTH
,
authenticationOptions =>
{
authenticationOptions.AuthScheme = CookieAuthenticationDefaults.AuthenticationScheme;
authenticationOptions.SilkierQuartzClaim = "Silkier";
authenticationOptions.SilkierQuartzClaimValue = "Quartz";
authenticationOptions.UserName = "admin";
authenticationOptions.UserPassword = "password";
authenticationOptions.AccessRequirement = SilkierQuartzAuthenticationOptions.SimpleAccessRequirement.AllowOnlyUsersWithClaim;
}
#else
,
authenticationOptions =>
{
authenticationOptions.AccessRequirement = SilkierQuartzAuthenticationOptions.SimpleAccessRequirement.AllowAnonymous;
}
#endif
);
services.AddOptions();
services.Configure<AppSettings>(Configuration);
services.Configure<InjectProperty>(options => { options.WriteText = "This is inject string"; });
services.AddQuartzJob<HelloJob>()
.AddQuartzJob<InjectSampleJob>()
.AddQuartzJob<HelloJobSingle>()
.AddQuartzJob<InjectSampleJobSingle>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseSilkierQuartz();
app.UseEndpoints(endpoints =>
{
endpoints.MapRazorPages();
});
}
According to the instructions we should add this to the startup
but UseSilkierQuartz takes Action not SilkierQuartzOptions
public static IApplicationBuilder UseSilkierQuartz(this IApplicationBuilder app, Action<Services> configure = null);
Is there a new instructions on how to get Silkier to work?