src/EntityFramework/Migrations/Design/CSharpMigrationCodeGenerator.cs
/// <summary>
/// Generates code to specify a set of column names using a lambda expression.
/// </summary>
/// <param name="columns"> The columns to generate code for. </param>
/// <param name="writer"> Text writer to add the generated code to. </param>
Generates code to specify a set of column names using a lambda expression.
Generates code to specify a set of column names using a lambda expression .
protected virtual void Generate(IEnumerable<string> columns, IndentedTextWriter writer)
        {
            Check.NotNull(columns, "columns");
            Check.NotNull(writer, "writer");
            writer.Write("t => ");
            if (columns.Count() == 1)
            {
                writer.Write("t." + ScrubName(columns.Single()));
            }
            else
            {
                writer.Write("new { " + columns.Join(c => "t." + ScrubName(c)) + " }");
            }
        }
protected virtual void Generate ( IEnumerable < string > columns , IndentedTextWriter writer ) { Check . NotNull ( columns , " " ) ; Check . NotNull ( writer , " " ) ; writer . Write ( " " ) ; if ( columns . Count ( ) == 1 ) { writer . Write ( " " + ScrubName ( columns . Single ( ) ) ) ; } else { writer . Write ( " " + columns . Join ( c => " " + ScrubName ( c ) ) + " " ) ; } }
Generates code to specify a set of column names using a lambda expression.
Generates code to specify a set of column names using a lambda expression .
columns
IEnumerable<string>
The columns to generate code for.
The columns to generate code for .
writer
IndentedTextWriter
Text writer to add the generated code to.
Text writer to add the generated code to .