コード例 #1
0
 public Startup(IConfiguration configurationRoot)
 {
     coreApplicationConfig = new CoreApplicationConfig()
                             .SideEffect(configurationRoot.Bind);
     jwtConfig = new JwtConfig()
                 .SideEffect(configurationRoot.GetSection("Jwt").Bind);
 }
コード例 #2
0
ファイル: Startup.cs プロジェクト: mrlldd/hookr-rent-service
        public Startup(IConfiguration configuration)
        {
            var config = new CoreApplicationConfig();

            configuration.Bind(config);
            applicationConfig = config;
        }
コード例 #3
0
        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
                                     );