public static IServiceCollection AddWestwindGlobalization(this IServiceCollection services, IConfiguration config) { var configurationSection = config.GetSection(nameof(DbResourceConfiguration)); var dbResourceConfiguration = configurationSection.Get <DbResourceConfiguration>(); DbRes.Initialize(dbResourceConfiguration); services.AddMvcCore().AddApplicationPart(Assembly.GetExecutingAssembly()); services.TryAddSingleton <IDbResourceDataManager, DbResourceSqlServerDataManager>(); services.TryAddSingleton <DbResourceConfiguration>(dbResourceConfiguration); services.TryAddSingleton(factory => factory.GetRequiredService <IOptions <DbResourceConfiguration> >().Value); services.TryAddSingleton <JavaScriptResourceHandler>(); return(services); }
public DbResTests() { DbRes.Initialize(new DbResourceConfiguration()); }