Guest User

Untitled

a guest
Dec 12th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. var host = new HostBuilder()
  6. .ConfigureAppConfiguration((hostContext, configApp) =>
  7. {
  8. configApp.AddCommandLine(args);
  9. })
  10. .ConfigureServices((hostContext, services) =>
  11. {
  12. // Add Coravel's Scheduling...
  13. services.AddScheduler();
  14. })
  15. .Build();
  16. // Configure the scheduled tasks....
  17. host.Services.UseScheduler(scheduler =>
  18. scheduler
  19. .Schedule(() => Console.WriteLine("This was scheduled every minute."))
  20. .EveryMinute()
  21. );
  22. // Run it!
  23. host.Run();
  24. }
  25. }
Add Comment
Please, Sign In to add comment