/// <summary> /// Configures the data type of the column that the property maps to when targeting a relational database. /// This should be the complete type name, including precision, scale, length, etc. /// </summary> /// <param name="propertyBuilder"> The builder for the property being configured. </param> /// <param name="typeName"> The name of the data type of the column. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> /// <returns> /// The same builder instance if the configuration was applied, /// <see langword="null" /> otherwise. /// </returns> public static IConventionPropertyBuilder HasColumnType( [NotNull] this IConventionPropertyBuilder propertyBuilder, [CanBeNull] string typeName, bool fromDataAnnotation = false) { if (!propertyBuilder.CanSetColumnType(typeName, fromDataAnnotation)) { return(null); } propertyBuilder.Metadata.SetColumnType(typeName, fromDataAnnotation); return(propertyBuilder); }