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