コード例 #1
0
        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));
        }
コード例 #2
0
 // 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;
 }