Exemplo n.º 1
0
        public override void ConfigureServices(IServiceCollection services)
        {
            _settings = services.BuildServiceProvider().GetService <InMemoryServerSettings>();

            _initializers = _settings.Initializers;

            base.ConfigureServices(services);
        }
        private static void RegisterSettings(
            IServiceCollection services,
            Type[] controllerTypes,
            Action <MvcOptions> configFunc,
            Action <IConfiguration, IServiceCollection> configureServices,
            Func <IConfiguration, IEnumerable <IMicroserviceInitializer> > initializers)
        {
            var settings = new InMemoryServerSettings
            {
                ControllerTypes   = controllerTypes,
                MvcOptionsConfig  = configFunc,
                ConfigureServices = configureServices,
                Initializers      = initializers
            };

            services.AddSingleton(settings);
        }