public Startup(IConfiguration configurationRoot) { coreApplicationConfig = new CoreApplicationConfig() .SideEffect(configurationRoot.Bind); jwtConfig = new JwtConfig() .SideEffect(configurationRoot.GetSection("Jwt").Bind); }
public Startup(IConfiguration configuration) { var config = new CoreApplicationConfig(); configuration.Bind(config); applicationConfig = config; }
public static IServiceCollection AddHookrCore(this IServiceCollection services, Assembly loadTypesFrom, ICoreApplicationConfig config) => services .AddAssemblyDependentServices(loadTypesFrom, config.Cache) .AddScoped <ITelegramUserIdProvider, TelegramUserIdProvider>() .AddScoped <IHookrRepository, HookrRepository>() .AddSingleton <IPolicySet, PolicySet>() .AddDbContext <HookrContext>(builder => builder .UseHookrCoreConfig(config.Database) #if DEBUG .EnableSensitiveDataLogging() #endif );