static void Main(string[] args) { const string host = "localhost"; const int port = 8089; Console.WriteLine("Starting Web API service..."); using (var webApiServer = new Server.WebApiServer(port)) { webApiServer.Open(); Console.WriteLine("Started query service."); Console.WriteLine("Staring client demo..."); Console.WriteLine("-------------------------------------------------"); new Client.Demo(host, port).Run(); Console.WriteLine(); Console.WriteLine("-------------------------------------------------"); Console.WriteLine("Done."); } Console.WriteLine("Terminated Web API service. Hit enter to exit."); Console.ReadLine(); }
private static void Main() { Title("JSON Serialization over Web API async"); const string host = "localhost"; const int port = 8089; PrintSetup("Starting Web API service..."); using var webServer = new Server.WebApiServer(port); webServer.Open(); PrintSetup("Staring client demo..."); PrintSetup("-------------------------------------------------"); new Client.AsyncDemo(() => new Client.RemoteRepository(host, port)).RunAsync().Wait(); PrintSetup(); PrintSetup("-------------------------------------------------"); PrintSetup("Done."); WaitForEnterKey(); }