RelationalPropertyBuilderExtensions.CanSetColumnType Method

Definition

Returns a value indicating whether the given data type can be set for the property.

public static bool CanSetColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string typeName, bool fromDataAnnotation = false);
public static bool CanSetColumnType (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder propertyBuilder, string? typeName, bool fromDataAnnotation = false);
static member CanSetColumnType : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder * string * bool -> bool
<Extension()>
Public Function CanSetColumnType (propertyBuilder As IConventionPropertyBuilder, typeName As String, Optional fromDataAnnotation As Boolean = false) As Boolean

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

true if the given data type can be set for the property.

Remarks

See Modeling entity types and relationships for more information and examples.

Applies to