コード例 #1
0
ファイル: HostingEngine.cs プロジェクト: yonglehou/Hosting
        public HostingEngine(
            IServiceCollection appServices,
            IStartupLoader startupLoader,
            IConfiguration config,
            bool captureStartupErrors)
        {
            if (appServices == null)
            {
                throw new ArgumentNullException(nameof(appServices));
            }

            if (startupLoader == null)
            {
                throw new ArgumentNullException(nameof(startupLoader));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            _config = config;
            _applicationServiceCollection = appServices;
            _startupLoader = startupLoader;
            _captureStartupErrors = captureStartupErrors;
            _applicationLifetime = new ApplicationLifetime();
            _applicationServiceCollection.AddInstance<IApplicationLifetime>(_applicationLifetime);
        }
コード例 #2
0
ファイル: WebApplication.cs プロジェクト: leloulight/Hosting
        public WebApplication(
            IServiceCollection appServices,
            IStartupLoader startupLoader,
            WebApplicationOptions options,
            IConfiguration config)
        {
            if (appServices == null)
            {
                throw new ArgumentNullException(nameof(appServices));
            }

            if (startupLoader == null)
            {
                throw new ArgumentNullException(nameof(startupLoader));
            }

            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            _config = config;
            _options = options;
            _applicationServiceCollection = appServices;
            _startupLoader = startupLoader;
            _applicationLifetime = new ApplicationLifetime();
            _applicationServiceCollection.AddSingleton<IApplicationLifetime>(_applicationLifetime);
        }
コード例 #3
0
ファイル: HostingEngine.cs プロジェクト: Kagamine/Hosting
 public HostingEngine(
     [NotNull] IServiceCollection appServices, 
     [NotNull] IStartupLoader startupLoader, 
     [NotNull] IConfiguration config)
 {
     _config = config;
     _applicationServiceCollection = appServices;
     _startupLoader = startupLoader;
     _applicationLifetime = new ApplicationLifetime();
 }