ConventionPropertyExtensions.SetValueConverter 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置此属性的自定义 ValueConverter 。
public static void SetValueConverter (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter converter, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter SetValueConverter (this Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter converter, bool fromDataAnnotation = false);
static member SetValueConverter : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * bool -> unit
static member SetValueConverter : Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * bool -> Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter
<Extension()>
Public Sub SetValueConverter (property As IConventionProperty, converter As ValueConverter, Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetValueConverter (property As IConventionProperty, converter As ValueConverter, Optional fromDataAnnotation As Boolean = false) As ValueConverter
参数
- property
- IConventionProperty
属性。
- converter
- ValueConverter
转换器,或者 null
删除任何以前设置的转换器。
- fromDataAnnotation
- Boolean
指示是否使用数据注释指定配置。
返回
配置的值。