src/Shared/EntityFramework/Migrations/Design/CSharpMigrationCodeGenerator.cs
/// <summary>
/// Generates code to perform an <see cref="AddPrimaryKeyOperation" /> as part of a <see cref="CreateTableOperation" />.
/// </summary>
/// <param name="addPrimaryKeyOperation"> The operation to generate code for. </param>
/// <param name="writer"> Text writer to add the generated code to. </param>
Generates code to perform an  as part of a .
Generates code to perform an as part of a .
protected virtual void GenerateInline(AddPrimaryKeyOperation addPrimaryKeyOperation, IndentedTextWriter writer)
        {
            Check.NotNull(writer, "writer");
            if (addPrimaryKeyOperation != null)
            {
                writer.WriteLine();
                writer.Write(".PrimaryKey(");
                Generate(addPrimaryKeyOperation.Columns, writer);
                if (!addPrimaryKeyOperation.HasDefaultName)
                {
                    writer.Write(", name: ");
                    writer.Write(Quote(addPrimaryKeyOperation.Name));
                }
                if (!addPrimaryKeyOperation.IsClustered)
                {
                    writer.Write(", clustered: false");
                }
                writer.Write(")");
            }
        }
protected virtual void GenerateInline ( AddPrimaryKeyOperation addPrimaryKeyOperation , IndentedTextWriter writer ) { Check . NotNull ( writer , " " ) ; if ( addPrimaryKeyOperation != null ) { writer . WriteLine ( ) ; writer . Write ( " " ) ; Generate ( addPrimaryKeyOperation . Columns , writer ) ; if ( ! addPrimaryKeyOperation . HasDefaultName ) { writer . Write ( " " ) ; writer . Write ( Quote ( addPrimaryKeyOperation . Name ) ) ; } if ( ! addPrimaryKeyOperation . IsClustered ) { writer . Write ( " " ) ; } writer . Write ( " " ) ; } }
Generates code to perform an  as part of a .
Generates code to perform an as part of a .
addPrimaryKeyOperation
AddPrimaryKeyOperation
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 .