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); } }
public string Get() { return(_dayOfTheWeekService.GetDayOfTheWeek()); }