30 lines
644 B
C#
30 lines
644 B
C#
using System;
|
|
using Hangfire;
|
|
using Microsoft.Owin;
|
|
using MileageTraker.Web.Email;
|
|
using Owin;
|
|
|
|
[assembly: OwinStartup(typeof(MileageTraker.Web.Startup))]
|
|
|
|
namespace MileageTraker.Web
|
|
{
|
|
public class Startup
|
|
{
|
|
public void Configuration(IAppBuilder app)
|
|
{
|
|
GlobalConfiguration.Configuration
|
|
.UseSqlServerStorage("MileageTrakerContext");
|
|
|
|
app.UseHangfireDashboard();
|
|
app.UseHangfireServer();
|
|
|
|
SetupRecurringJobs();
|
|
}
|
|
|
|
private void SetupRecurringJobs()
|
|
{
|
|
RecurringJob.AddOrUpdate<ServiceReminderEmailService>(
|
|
"serviceReminderJob", s => s.SendAllNotificationEmails(), Cron.Weekly(DayOfWeek.Monday, 6));
|
|
}
|
|
}
|
|
} |