Share via


AnnotationCodeGenerator Class

Definition

Inherit from this class to create a service that allows for code generation of custom annotations as part of scaffolding Migrations. The derived class should be set onto the MigrationCodeGenerator.

public abstract class AnnotationCodeGenerator
type AnnotationCodeGenerator = class
Public MustInherit Class AnnotationCodeGenerator
Inheritance
AnnotationCodeGenerator

Remarks

Note that an AnnotationCodeGenerator is not needed if the annotation uses a simple string value, or if calling ToString on the annotation object is sufficient for use in the scaffolded Migration.

Constructors

AnnotationCodeGenerator()

Methods

Generate(String, Object, IndentedTextWriter)

Implement this method to generate code for the given annotation value.

GetExtraNamespaces(IEnumerable<String>)

Override this method to return additional namespaces that should be included in the code generated for the scaffolded migration. The default implementation returns an empty enumeration.

Applies to