共用方式為


ConventionPropertyExtensions.SetValueConverter 方法

定義

設定這個屬性的自訂 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

指出是否使用資料批註來指定組態。

傳回

已設定的值。

適用於