PropertyBuilder.HasConversion 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
HasConversion(Type, Type, Type)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type conversionType, Type? comparerType, Type? providerComparerType);
abstract member HasConversion : Type * Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type * Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, comparerType As Type, providerComparerType As Type) As PropertyBuilder
參數
- conversionType
- Type
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
- comparerType
- Type
繼承自 ValueComparer 的型別。
- providerComparerType
- Type
繼承自 ValueComparer 的型別,用於提供者值。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(Type, ValueComparer)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type providerClrType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer valueComparer);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type conversionType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
abstract member HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (providerClrType As Type, valueComparer As ValueComparer) As PropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, valueComparer As ValueComparer) As PropertyBuilder
參數
- providerClrTypeconversionType
- Type
要轉換成 和 來源的型別。
- valueComparer
- ValueComparer
在轉換之前,要用於值的比較子。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(ValueConverter, ValueComparer, ValueComparer)
設定 屬性,讓屬性值使用指定的 ValueConverter 來回轉換至資料庫。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (converter As ValueConverter, valueComparer As ValueComparer, providerComparer As ValueComparer) As PropertyBuilder
參數
- converter
- ValueConverter
要使用的轉換器。
- valueComparer
- ValueComparer
在轉換之前,要用於值的比較子。
- providerComparer
- ValueComparer
要用於提供者值的比較子。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(Type, ValueComparer, ValueComparer)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type conversionType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerComparer);
abstract member HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, valueComparer As ValueComparer, providerComparer As ValueComparer) As PropertyBuilder
參數
- conversionType
- Type
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
- valueComparer
- ValueComparer
在轉換之前,要用於值的比較子。
- providerComparer
- ValueComparer
要用於提供者值的比較子。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(Type)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type providerClrType);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type? conversionType);
abstract member HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
abstract member HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (providerClrType As Type) As PropertyBuilder
Public Overridable Function HasConversion (conversionType As Type) As PropertyBuilder
參數
- providerClrTypeconversionType
- Type
要轉換成 和 來源的型別。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(ValueConverter, ValueComparer)
設定 屬性,讓屬性值使用指定的 ValueConverter 來回轉換至資料庫。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter converter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer valueComparer);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (converter As ValueConverter, valueComparer As ValueComparer) As PropertyBuilder
參數
- converter
- ValueConverter
要使用的轉換器。
- valueComparer
- ValueComparer
在轉換之前,要用於值的比較子。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(ValueConverter)
設定 屬性,讓屬性值使用指定的 ValueConverter 來回轉換至資料庫。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter converter);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (converter As ValueConverter) As PropertyBuilder
參數
- converter
- ValueConverter
要使用的轉換器。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion(Type, Type)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion (Type conversionType, Type? comparerType);
abstract member HasConversion : Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion (conversionType As Type, comparerType As Type) As PropertyBuilder
參數
- conversionType
- Type
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
- comparerType
- Type
繼承自 ValueComparer 的型別。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion<TConversion,TComparer,TProviderComparer>()
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion,TComparer,TProviderComparer> () where TComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer where TProviderComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer;
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer and 'ProviderComparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer and 'ProviderComparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
Public Overridable Function HasConversion(Of TConversion, TComparer, TProviderComparer) () As PropertyBuilder
類型參數
- TConversion
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
- TComparer
繼承自 ValueComparer 的型別。
- TProviderComparer
繼承自 ValueComparer 的型別,用於提供者值。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion<TConversion,TComparer>()
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion,TComparer> () where TComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer;
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
Public Overridable Function HasConversion(Of TConversion, TComparer) () As PropertyBuilder
類型參數
- TConversion
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
- TComparer
繼承自 ValueComparer 的型別。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion<TConversion>(ValueComparer, ValueComparer)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion> (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? providerComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion(Of TConversion) (valueComparer As ValueComparer, providerComparer As ValueComparer) As PropertyBuilder
類型參數
- TConversion
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
參數
- valueComparer
- ValueComparer
在轉換之前,要用於值的比較子。
- providerComparer
- ValueComparer
要用於提供者值的比較子。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion<TConversion>()
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TProvider> ();
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion> ();
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion(Of TProvider) () As PropertyBuilder
Public Overridable Function HasConversion(Of TConversion) () As PropertyBuilder
類型參數
- TProvider TConversion
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。
適用於
HasConversion<TConversion>(ValueComparer)
設定 屬性,以便在寫入資料庫之前轉換屬性值,並在從資料庫讀取時重新轉換。
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TProvider> (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer valueComparer);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion> (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion(Of TProvider) (valueComparer As ValueComparer) As PropertyBuilder
Public Overridable Function HasConversion(Of TConversion) (valueComparer As ValueComparer) As PropertyBuilder
類型參數
- TProvider TConversion
要轉換成 和 的型別,或繼承自 ValueConverter 的類型。
參數
- valueComparer
- ValueComparer
在轉換之前,要用於值的比較子。
傳回
相同的產生器實例,以便鏈結多個組態呼叫。