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); }); }
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); }); }