public override void Configure(IFunctionsHostBuilder builder) { var services = builder.Services; var configuration = StartupManager.GetConfiguration(); var appSettings = services.ConfigureSettings <FunctionAppSettings>(configuration); services.AddTransient <IAppService, AppService>(); }
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()); }