src/Shared/EntityFramework/Migrations/Design/CSharpMigrationCodeGenerator.cs
/// <summary>
/// Generates code for to re-create the given dictionary of annotations for use when passing
/// these annotations as a parameter of a <see cref="DbMigration"/>. call.
/// </summary>
/// <param name="annotations">The annotations to generate.</param>
/// <param name="writer">The writer to which generated code should be written.</param>
Generates code for to re-create the given dictionary of annotations for use when passing
these annotations as a parameter of a . call.
Generates code for to re - create the given dictionary of annotations for use when passing these annotations as a parameter of a . call .
protected internal virtual void GenerateAnnotations(IDictionary<string, object> annotations, IndentedTextWriter writer)
        {
            Check.NotNull(annotations, "annotations");
            Check.NotNull(writer, "writer");
            writer.WriteLine("new Dictionary<string, object>");
            writer.WriteLine("{");
            writer.Indent++;
            foreach (var name in annotations.Keys.OrderBy(k => k))
            {
                writer.Write("{ ");
                writer.Write(Quote(name) + ", ");
                GenerateAnnotation(name, annotations[name], writer);
                writer.WriteLine(" },");
            }
            writer.Indent--;
            writer.Write("}");
        }
protected internal virtual void GenerateAnnotations ( IDictionary < string , object > annotations , IndentedTextWriter writer ) { Check . NotNull ( annotations , " " ) ; Check . NotNull ( writer , " " ) ; writer . WriteLine ( " " ) ; writer . WriteLine ( " " ) ; writer . Indent ++ ; foreach ( var name in annotations . Keys . OrderBy ( k => k ) ) { writer . Write ( " " ) ; writer . Write ( Quote ( name ) + " " ) ; GenerateAnnotation ( name , annotations [ name ] , writer ) ; writer . WriteLine ( " " ) ; } writer . Indent -- ; writer . Write ( " " ) ; }
Generates code for to re-create the given dictionary of annotations for use when passing
these annotations as a parameter of a .
Generates code for to re - create the given dictionary of annotations for use when passing these annotations as a parameter of a .
annotations
IDictionary<string, object>
The annotations to generate.
The annotations to generate .
writer
IndentedTextWriter
The writer to which generated code should be written.
The writer to which generated code should be written .