static void Main() { CoreCommandHandler coreCommandHandler = DependencyResolver.Container.Resolve <CoreCommandHandler>(); string command = GetCommand(); while (command != "exit") { coreCommandHandler.Handle(command); command = GetCommand(); } }
protected override Task ExecuteAsync(CancellationToken stoppingToken) { string command = GetCommand(); while (command != "exit" && !stoppingToken.IsCancellationRequested) { coreCommandHandler.Handle(command); command = GetCommand(); } System.Console.WriteLine("Click Ctrl+C"); return(Task.CompletedTask); }