コード例 #1
0
        public DatabaseContext <Player> CreateDbContext(string[] args)
        {
            var configRoot     = ServerHandler.CreateConfigurationRoot("appsettings.json");
            var optionsBuilder = new DbContextOptionsBuilder <DatabaseContext <Player> >();

            optionsBuilder.UseNpgsql(configRoot.GetConnectionString("NetScape"),
                                     x => x.MigrationsAssembly(typeof(DatabaseContext <Player>)
                                                               .Assembly.GetName().Name));
            return(new DatabaseContext <Player>(optionsBuilder.Options));
        }