RelationalPropertyBuilderExtensions.HasColumnType Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasColumnType(PropertyBuilder, String) |
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. |
HasColumnType(IConventionPropertyBuilder, String, Boolean) |
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. |
HasColumnType<TProperty>(PropertyBuilder<TProperty>, String) |
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. |
HasColumnType(PropertyBuilder, String)
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.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string typeName);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder propertyBuilder, string? typeName);
static member HasColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
<Extension()>
Public Function HasColumnType (propertyBuilder As PropertyBuilder, typeName As String) As PropertyBuilder
Parameters
- propertyBuilder
- PropertyBuilder
The builder for the property being configured.
- typeName
- String
The name of the data type of the column.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Modeling entity types and relationships for more information and examples.
Applies to
HasColumnType(IConventionPropertyBuilder, String, Boolean)
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.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string typeName, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? typeName, bool fromDataAnnotation = false);
static member HasColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
<Extension()>
Public Function HasColumnType (propertyBuilder As IConventionPropertyBuilder, typeName As String, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder
Parameters
- propertyBuilder
- IConventionPropertyBuilder
The builder for the property being configured.
- typeName
- String
The name of the data type of the column.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The same builder instance if the configuration was applied,
null
otherwise.
Remarks
See Modeling entity types and relationships for more information and examples.
Applies to
HasColumnType<TProperty>(PropertyBuilder<TProperty>, String)
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.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasColumnType<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string typeName);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> HasColumnType<TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> propertyBuilder, string? typeName);
static member HasColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
<Extension()>
Public Function HasColumnType(Of TProperty) (propertyBuilder As PropertyBuilder(Of TProperty), typeName As String) As PropertyBuilder(Of TProperty)
Type Parameters
- TProperty
The type of the property being configured.
Parameters
- propertyBuilder
- PropertyBuilder<TProperty>
The builder for the property being configured.
- typeName
- String
The name of the data type of the column.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Modeling entity types and relationships for more information and examples.
Applies to
Entity Framework