語言

IConventionPropertyBuilder.HasConverter(Type, Boolean) 方法

定義

設定屬性,使屬性值能利用給定 ValueConverter的 與資料庫 之間轉換。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder? HasConverter(Type? converterType, bool fromDataAnnotation = false);
abstract member HasConverter : Type * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionPropertyBuilder
Public Function HasConverter (converterType As Type, Optional fromDataAnnotation As Boolean = false) As IConventionPropertyBuilder

參數

converterType
Type

一種由 ValueConverter衍生出來的類型,或 null 用來移除先前設定的任何轉換器。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

傳回

如果設定是套用,則使用同一個建構者實例, null 否則。

適用於