コード例 #1
0
        public void AddServer <TStartup>(string serviceName) where TStartup : class
        {
            if (string.IsNullOrEmpty(nameof(serviceName)))
            {
                throw new ArgumentNullException(nameof(serviceName));
            }

            var port = PortManager.GetAvailablePort();

            Ports.Add(port);

            var serviceHost = GetWebHost <TStartup>(port);

            Servers.Add(serviceName, serviceHost);

            ExtraSettings.Add($"Services:{serviceName}:Endpoint", $"http://localhost:{port}");
        }
コード例 #2
0
 public void AddExtraSettings(Action <JsonSerializerSettings> action)
 {
     Guard.AgainstNull(action, nameof(action));
     ExtraSettings.Add(action);
 }