ForeignKeyAssociationMappingConfiguration.HasColumnAnnotation Method (String, String, Object)
Sets an annotation in the model for a database column that has been configured with MapKey. The annotation value can later be used when processing the column such as when creating migrations.
Assembly: EntityFramework (in EntityFramework.dll)
public ForeignKeyAssociationMappingConfiguration HasColumnAnnotation( string keyColumnName, string annotationName, object value )
Parameters
- keyColumnName
-
Type:
System.String
The name of the column that was configured with the HasKey method.
- annotationName
-
Type:
System.String
The annotation name, which must be a valid C#/EDM identifier.
- value
-
Type:
System.Object
The annotation value, which may be a string or some other type that can be serialized with an IMetadataAnnotationSerializer
Return Value
Type: System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyAssociationMappingConfigurationThe same ForeignKeyAssociationMappingConfiguration instance so that multiple calls can be chained.
It will likely be necessary to register a IMetadataAnnotationSerializer if the type of the annotation value is anything other than a string. Passing a null value clears any annotation with the given name on the column that had been previously set.