示例#1
0
        public void CompareSchema()
        {
            var superSetConnectionString = ConfigurationManager.ConnectionStrings["Persistence"].ConnectionString;
            var subSetConnectionString   = ConfigurationManager.ConnectionStrings["PersistenceEF"].ConnectionString;

            SqlServerSchema.Remove(subSetConnectionString);

            var configuration = new EntityFrameworkDbContextConfiguration <CompareContext>(connectionStringOrName => new CompareContext(connectionStringOrName));

            configuration.ConnectionString(subSetConnectionString);
            configuration.CreateSchema();

            SqlServerSchema.AssertContained(new ConsoleLogger(), superSetConnectionString, subSetConnectionString, false, "__MigrationHistory");
        }
示例#2
0
        public void CompareSchema()
        {
            var superSetConnectionString = ConfigurationManager.ConnectionStrings["Persistence"].ConnectionString;
            var subSetConnectionString   = ConfigurationManager.ConnectionStrings["PersistenceEF"].ConnectionString;

            SqlServerSchema.Remove(subSetConnectionString);

            var configuration = new EntityFrameworkConfiguration();

            configuration.ConnectionString(subSetConnectionString);
            configuration.ProviderName(EntityFrameworkConfiguration.SqlServerProviderName);
            configuration.RegisterEntitiesFromAssemblyOf <FooConfiguration>();
            configuration.CreateSchema();

            SqlServerSchema.AssertContained(new ConsoleLogger(), superSetConnectionString, subSetConnectionString, false, "EdmMetadata");
        }