Beispiel #1
0
        public async Task InitializeAsync()
        {
            await _sqlServer.InitializeAsync();

            var connectionString = _sqlServer.CreateConnectionString(DbName);
            var options          = new DbContextOptionsBuilder <DatabaseContext>()
                                   .UseSqlServer(connectionString)
                                   .Options;

            Context = new DatabaseContext(options);
            Context.Database.Migrate();
        }
Beispiel #2
0
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            var connectionString = _resource.CreateConnectionString("database_" + Guid.NewGuid());

            optionsBuilder.UseSqlServer(connectionString);
        }