コード例 #1
0
 public static void UseMySQL(
     [NotNull] this QfDbContextOptions options,
     [CanBeNull] Action <MySqlDbContextOptionsBuilder> mySQLOptionsAction = null)
 {
     options.PreConfigure(context =>
     {
         context.DbContextOptions.ConfigureWarnings(warnings => warnings.Ignore(CoreEventId.LazyLoadOnDisposedContextWarning));
     });
     options.Configure(context =>
     {
         context.UseMySQL(mySQLOptionsAction);
     });
 }
コード例 #2
0
 public static void UseSqlServer <TDbContext>(
     [NotNull] this QfDbContextOptions options,
     [CanBeNull] Action <SqlServerDbContextOptionsBuilder> sqlServerOptionsAction = null)
     where TDbContext : QfDbContext <TDbContext>
 {
     options.PreConfigure(context =>
     {
         context.DbContextOptions.ConfigureWarnings(warnings => warnings.Ignore(CoreEventId.LazyLoadOnDisposedContextWarning));
     });
     options.Configure <TDbContext>(context =>
     {
         context.UseSqlServer(sqlServerOptionsAction);
     });
 }