protected override Task ExecuteAsync(CancellationToken stoppingToken) { var Scope = Factory.CreateScope(); Client = Scope.ServiceProvider.GetRequiredService <ITestClient>(); Console.WriteLine("Start Listening for Messages"); Client.RegisterHandler( (message, token) => { State.AddMessage(message); return(Task.CompletedTask); }); return(Task.CompletedTask); }