Пример #1
0
        public override void Configure(IFunctionsHostBuilder builder)
        {
            var services = builder.Services;

            var configuration = StartupManager.GetConfiguration();

            var appSettings = services.ConfigureSettings <FunctionAppSettings>(configuration);

            services.AddTransient <IAppService, AppService>();
        }
Пример #2
0
        public ServiceProvider Configure()
        {
            var services = new ServiceCollection();

            //var configuration = StartupManager.GetRequiredJsonConfiguration("appsettings.json");
            var configuration = StartupManager.GetConfiguration();

            //var appSettings = services.ConfigureAndValidateOptionsDataAnnotations<ConsoleAppSettings>(configuration);
            var appSettings = services.ConfigureSettings <FunctionAppSettings>(configuration);

            services.AddSingleton <IAppService, AppService>();

            return(services.BuildServiceProvider());
        }