예제 #1
0
        public void TestCreateStoredProcedure()
        {
            EasyMig.CreateStoredProcedure("p1_test")
            .AddInParameter("@id", ColumnType.Int())
            .AddOutParameter("@age", ColumnType.Int())
            .SetBody("select @age=age from users where id=@id");

            EasyMig.ToSqlServer.DoMigrationsFromMemory(connectionString);

            Assert.IsTrue(EasyMig.Information.SqlServerAttachedDbFile.ProcedureExists("p1_test", connectionString));
        }
예제 #2
0
        public void TestCreateStoredProcedure()
        {
            this.BeforeEach();

            var dbName    = "db1";
            var tableName = "users";

            EasyMig.ClearMigrations();

            EasyMig.CreateStoredProcedure("p1_test")
            .AddInParameter("p_id", ColumnType.Int())
            .AddOutParameter("p_age", ColumnType.Int())
            .SetBody("select age into p_age from users where id=p_id;");

            EasyMig.ToMySql.DoMigrationsFromMemory(completeConnectionString);

            Assert.IsTrue(EasyMig.Information.MySql.ProcedureExists(dbName, "p1_test", completeConnectionString));
        }