public SqlServerPasswordlessLoginDbContext CreateDbContext(string[] args) { var optionsBuilder = new DbContextOptionsBuilder <PasswordlessLoginDbContext>(); var config = new SqlServerPasswordlessDatabaseConfig(); var connection = "(none)"; optionsBuilder.UseSqlServer(connection, b => { b.MigrationsAssembly("SimpleIAM.PasswordlessLogin.SqlServer"); b.MigrationsHistoryTable("__PasswordlessMigrationsHistory", config.Schema); }); return(new SqlServerPasswordlessLoginDbContext(optionsBuilder.Options, config)); }
// NOTE: Using type of DbContextOptions<PasswordlessLoginDbContext> for options so that it can be passed to the base class. public SqlServerPasswordlessLoginDbContext(DbContextOptions <PasswordlessLoginDbContext> options, SqlServerPasswordlessDatabaseConfig config = null) : base(options) { _schema = (config ?? new SqlServerPasswordlessDatabaseConfig())?.Schema; }