Exemplo n.º 1
0
 public SqlServerE2EFixture()
 {
     SqlServerTestStore.CreateDatabase(
         "SqlServerReverseEngineerTestE2E",
         scriptPath: "ReverseEngineering/E2E.sql",
         nonMasterScript: false,
         recreateIfAlreadyExists: true);
 }
Exemplo n.º 2
0
        public SqlAzureFixture()
        {
            SqlServerTestStore.CreateDatabase("adventureworks", scriptPath: "SqlAzure/adventureworks.sql", nonMasterScript: true);

            Services = new ServiceCollection()
                       .AddEntityFrameworkSqlServer()
                       .AddSingleton <ILoggerFactory>(new TestSqlLoggerFactory()).BuildServiceProvider();

            Options = new DbContextOptionsBuilder()
                      .UseInternalServiceProvider(Services)
                      .EnableSensitiveDataLogging()
                      .UseSqlServer(SqlServerTestStore.CreateConnectionString("adventureworks")).Options;
        }
Exemplo n.º 3
0
        public SqlAzureFixture()
        {
            SqlServerTestStore.CreateDatabase("adventureworks", scriptPath: "SqlAzure/adventureworks.sql", recreateIfAlreadyExists: false);

            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.EnableSensitiveDataLogging()
            .UseSqlServer(SqlServerTestStore.CreateConnectionString("adventureworks"));
            Options = optionsBuilder.Options;

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddEntityFramework()
            .AddSqlServer();
            serviceCollection.AddSingleton <ILoggerFactory>(new TestSqlLoggerFactory());
            Services = serviceCollection.BuildServiceProvider();
        }
Exemplo n.º 4
0
 public SqlServerE2EFixture()
 {
     SqlServerTestStore.CreateDatabase(
         "SqlServerReverseEngineerTestE2E", "ReverseEngineering/E2E.sql", true);
 }
 public static SqlServerTestStore GetSharedStore()
 {
     return(SqlServerTestStore.GetOrCreateShared(
                DatabaseName,
                () => SqlServerTestStore.CreateDatabase(DatabaseName, scriptPath: @"Northwind.sql")));
 }