public static ASFBuilder AddDbContext(this ASFBuilder builder, Action <DbContextOptionsBuilder> configureDbContext, bool allowCache) { if (allowCache) { builder.AddDbContextCache(configureDbContext); } else { builder.AddDbContext(configureDbContext); } return(builder); }
public static ASFBuilder AddDbContext(this ASFBuilder builder, Action <DbContextOptionsBuilder> configureDbContext, IHostingEnvironment environment) { if (environment.IsDevelopment()) { builder.AddDbContext(configureDbContext); } else { builder.AddDbContextCache(configureDbContext); } return(builder); }