RuntimeModel.AddTypeMappingConfiguration 方法

定义

添加标量类型的配置。

public virtual Microsoft.EntityFrameworkCore.Metadata.RuntimeTypeMappingConfiguration AddTypeMappingConfiguration (Type clrType, int? maxLength = default, bool? unicode = default, int? precision = default, int? scale = default, Type? providerPropertyType = default, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? valueConverter = default);
abstract member AddTypeMappingConfiguration : Type * Nullable<int> * Nullable<bool> * Nullable<int> * Nullable<int> * Type * Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.RuntimeTypeMappingConfiguration
override this.AddTypeMappingConfiguration : Type * Nullable<int> * Nullable<bool> * Nullable<int> * Nullable<int> * Type * Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.RuntimeTypeMappingConfiguration
Public Overridable Function AddTypeMappingConfiguration (clrType As Type, Optional maxLength As Nullable(Of Integer) = Nothing, Optional unicode As Nullable(Of Boolean) = Nothing, Optional precision As Nullable(Of Integer) = Nothing, Optional scale As Nullable(Of Integer) = Nothing, Optional providerPropertyType As Type = Nothing, Optional valueConverter As ValueConverter = Nothing) As RuntimeTypeMappingConfiguration

参数

clrType
Type

属性将保留的值的类型。

maxLength
Nullable<Int32>

此属性类型中允许的最大数据长度。

unicode
Nullable<Boolean>

一个 值,该值指示属性是否可以保留 Unicode 字符。

precision
Nullable<Int32>

此属性类型中允许的数据的精度。

scale
Nullable<Int32>

此属性类型中允许的数据小数位数。

providerPropertyType
Type

属性值在发送到数据库提供程序之前将转换为的类型。

valueConverter
ValueConverter

此类型的自定义 ValueConverter

返回

新建的属性。

适用于