src/Shared/EntityFramework/Migrations/Design/VisualBasicMigrationCodeGenerator.cs
/// <summary>
/// Generates code to perform a <see cref="DropTableOperation" />.
/// </summary>
/// <param name="dropTableOperation"> The operation to generate code for. </param>
/// <param name="writer"> Text writer to add the generated code to. </param>
Generates code to perform a .
Generates code to perform a .
protected virtual void Generate(DropTableOperation dropTableOperation, IndentedTextWriter writer)
        {
            Check.NotNull(dropTableOperation, "dropTableOperation");
            Check.NotNull(writer, "writer");
            writer.Write("DropTable(");
            writer.Write(Quote(dropTableOperation.Name));
            if (dropTableOperation.RemovedAnnotations.Any())
            {
                writer.Indent++;
                writer.WriteLine(",");
                writer.Write("removedAnnotations := ");
                GenerateAnnotations(dropTableOperation.RemovedAnnotations, writer);
                writer.Indent--;
            }
            var columns = dropTableOperation.RemovedColumnAnnotations;
            if (columns.Any())
            {
                writer.Indent++;
                writer.WriteLine(",");
                writer.Write("removedColumnAnnotations := ");
                writer.WriteLine("New Dictionary(Of String, IDictionary(Of String, Object)) From _");
                writer.WriteLine("{");
                writer.Indent++;
                var columnNames = columns.Keys.OrderBy(k => k).ToArray();
                for (var i = 0; i < columnNames.Length; i++)
                {
                    writer.WriteLine("{");
                    writer.Indent++;
                    writer.WriteLine(Quote(columnNames[i]) + ",");
                    GenerateAnnotations(columns[columnNames[i]], writer);
                    writer.WriteLine();
                    writer.Indent--;
                    writer.WriteLine(i < columnNames.Length - 1 ? " }," : " }");
                }
                writer.Indent--;
                writer.Write("}");
                writer.Indent--;
            }
            writer.WriteLine(")");
        }
protected virtual void Generate ( DropTableOperation dropTableOperation , IndentedTextWriter writer ) { Check . NotNull ( dropTableOperation , " " ) ; Check . NotNull ( writer , " " ) ; writer . Write ( " " ) ; writer . Write ( Quote ( dropTableOperation . Name ) ) ; if ( dropTableOperation . RemovedAnnotations . Any ( ) ) { writer . Indent ++ ; writer . WriteLine ( " " ) ; writer . Write ( " " ) ; GenerateAnnotations ( dropTableOperation . RemovedAnnotations , writer ) ; writer . Indent -- ; } var columns = dropTableOperation . RemovedColumnAnnotations ; if ( columns . Any ( ) ) { writer . Indent ++ ; writer . WriteLine ( " " ) ; writer . Write ( " " ) ; writer . WriteLine ( " " ) ; writer . WriteLine ( " " ) ; writer . Indent ++ ; var columnNames = columns . Keys . OrderBy ( k => k ) . ToArray ( ) ; for ( var i = 0 ; i < columnNames . Length ; i ++ ) { writer . WriteLine ( " " ) ; writer . Indent ++ ; writer . WriteLine ( Quote ( columnNames [ i ] ) + " " ) ; GenerateAnnotations ( columns [ columnNames [ i ] ] , writer ) ; writer . WriteLine ( ) ; writer . Indent -- ; writer . WriteLine ( i < columnNames . Length - 1 ? " " : " " ) ; } writer . Indent -- ; writer . Write ( " " ) ; writer . Indent -- ; } writer . WriteLine ( " " ) ; }
Generates code to perform a .
Generates code to perform a .
dropTableOperation
DropTableOperation
The operation to generate code for.
The operation to generate code for .
writer
IndentedTextWriter
Text writer to add the generated code to.
Text writer to add the generated code to .