Share via


ConventionPrimitivePropertyConfiguration.HasColumnAnnotation Method

Definition

Sets an annotation in the model for the database column used to store the property. The annotation value can later be used when processing the column such as when creating migrations.

public virtual System.Data.Entity.ModelConfiguration.Configuration.ConventionPrimitivePropertyConfiguration HasColumnAnnotation (string name, object value);
abstract member HasColumnAnnotation : string * obj -> System.Data.Entity.ModelConfiguration.Configuration.ConventionPrimitivePropertyConfiguration
override this.HasColumnAnnotation : string * obj -> System.Data.Entity.ModelConfiguration.Configuration.ConventionPrimitivePropertyConfiguration
Public Overridable Function HasColumnAnnotation (name As String, value As Object) As ConventionPrimitivePropertyConfiguration

Parameters

name
String

The annotation name, which must be a valid C#/EDM identifier.

value
Object

The annotation value, which may be a string or some other type that can be serialized with an IMetadataAnnotationSerializer

Returns

The same configuration instance so that multiple calls can be chained.

Remarks

It will likely be necessary to register a IMetadataAnnotationSerializer if the type of the annotation value is anything other than a string. Calling this method will have no effect if the annotation with the given name has already been configured.

Applies to