Example #1
0
 protected override async Task CustomWorkerLogic(CancellationToken stoppingToken)
 {
     while (!stoppingToken.IsCancellationRequested)
     {
         Console.WriteLine($"The day is {_dayOfTheWeekService.GetDayOfTheWeek()}");
         Console.WriteLine($"The time is {DateTime.Now.ToLongTimeString()}");
         Console.WriteLine(" --- ");
         await Task.Delay(4000);
     }
 }
Example #2
0
 public string Get()
 {
     return(_dayOfTheWeekService.GetDayOfTheWeek());
 }