Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- var host = new HostBuilder()
- .ConfigureAppConfiguration((hostContext, configApp) =>
- {
- configApp.AddCommandLine(args);
- })
- .ConfigureServices((hostContext, services) =>
- {
- // Add Coravel's Scheduling...
- services.AddScheduler();
- })
- .Build();
- // Configure the scheduled tasks....
- host.Services.UseScheduler(scheduler =>
- scheduler
- .Schedule(() => Console.WriteLine("This was scheduled every minute."))
- .EveryMinute()
- );
- // Run it!
- host.Run();
- }
- }
Add Comment
Please, Sign In to add comment