src/EntityFramework/Migrations/Design/CSharpMigrationCodeGenerator.cs
/// <summary>
/// Generates code to perform a <see cref="CreateIndexOperation" />.
/// </summary>
/// <param name="createIndexOperation"> 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(CreateIndexOperation createIndexOperation, IndentedTextWriter writer)
        {
            Check.NotNull(createIndexOperation, "createIndexOperation");
            Check.NotNull(writer, "writer");
            writer.Write("CreateIndex(");
            writer.Write(Quote(createIndexOperation.Table));
            writer.Write(", ");
            var compositeIndex = createIndexOperation.Columns.Count() > 1;
            if (compositeIndex)
            {
                writer.Write("new[] { ");
            }
            writer.Write(createIndexOperation.Columns.Join(Quote));
            if (compositeIndex)
            {
                writer.Write(" }");
            }
            WriteIndexParameters(createIndexOperation, writer);
            writer.WriteLine(");");
        }
protected virtual void Generate ( CreateIndexOperation createIndexOperation , IndentedTextWriter writer ) { Check . NotNull ( createIndexOperation , " " ) ; Check . NotNull ( writer , " " ) ; writer . Write ( " " ) ; writer . Write ( Quote ( createIndexOperation . Table ) ) ; writer . Write ( " " ) ; var compositeIndex = createIndexOperation . Columns . Count ( ) > 1 ; if ( compositeIndex ) { writer . Write ( " " ) ; } writer . Write ( createIndexOperation . Columns . Join ( Quote ) ) ; if ( compositeIndex ) { writer . Write ( " " ) ; } WriteIndexParameters ( createIndexOperation , writer ) ; writer . WriteLine ( " " ) ; }
Generates code to perform a .
Generates code to perform a .
createIndexOperation
CreateIndexOperation
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 .