public virtual void ScaffoldMigration([NotNull] IMigrationMetadata migration)
        {
            Check.NotNull(migration, "migration");

            var className             = GetClassName(migration);
            var stringBuilder         = new IndentedStringBuilder();
            var metadataStringBuilder = new IndentedStringBuilder();

            MigrationCodeGenerator.GenerateMigrationClass(Namespace, className, migration, stringBuilder);
            MigrationCodeGenerator.GenerateMigrationMetadataClass(Namespace, className, migration, metadataStringBuilder);

            OnMigrationScaffolded(className, stringBuilder.ToString(), metadataStringBuilder.ToString());
        }
示例#2
0
        protected virtual void ScaffoldMigration(
            [NotNull] IMigrationMetadata migration,
            [NotNull] IndentedStringBuilder migrationCode,
            [NotNull] IndentedStringBuilder migrationMetadataCode)
        {
            Check.NotNull(migration, "migration");
            Check.NotNull(migrationCode, "migrationCode");
            Check.NotNull(migrationMetadataCode, "migrationMetadataCode");

            var className = GetClassName(migration);

            MigrationCodeGenerator.GenerateMigrationClass(MigrationNamespace, className, migration, migrationCode);
            MigrationCodeGenerator.GenerateMigrationMetadataClass(MigrationNamespace, className, migration, migrationMetadataCode);
        }