private void InvokeHostStop() { if (ServiceHosts.Any()) { foreach (var host in ServiceHosts) { host.Stop(); } } }
public void Start() { if (webHost == null) { IWebHostBuilder webHostBuilder = WebHost.CreateDefaultBuilder().UseUrls(Url) .Configure(app => Configure(app)).ConfigureServices(services => ConfigureServices(services)); if (ServiceHosts.Any()) { webHost = webHostBuilder.Build(); } } webHost.Run(); }