语言

PropertyBuilder.HasConversion 方法

定义

重载

名称 说明
HasConversion(Type, Type, Type)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion(Type, ValueComparer)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion(ValueConverter, ValueComparer, ValueComparer)

配置属性,以便使用给定 ValueConverter的属性值转换到数据库和从数据库转换。

HasConversion(Type, ValueComparer, ValueComparer)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion(Type)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion(ValueConverter, ValueComparer)

配置属性,以便使用给定 ValueConverter的属性值转换到数据库和从数据库转换。

HasConversion(ValueConverter)

配置属性,以便使用给定 ValueConverter的属性值转换到数据库和从数据库转换。

HasConversion(Type, Type)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion<TConversion,TComparer,TProviderComparer>()

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion<TConversion,TComparer>()

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion<TConversion>(ValueComparer, ValueComparer)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion<TConversion>()

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion<TConversion>(ValueComparer)

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

HasConversion(Type, Type, Type)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

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)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion(Type conversionType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion(Type providerClrType, 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 (conversionType As Type, valueComparer As ValueComparer) As PropertyBuilder
Public Overridable Function HasConversion (providerClrType As Type, valueComparer As ValueComparer) As PropertyBuilder

参数

providerClrTypeconversionType
Type

要转换到和传出的类型。

valueComparer
ValueComparer

转换前要用于值的比较器。

返回

同一个生成器实例,以便可以链接多个配置调用。

适用于

HasConversion(ValueConverter, ValueComparer, ValueComparer)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便使用给定 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)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

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)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion(Type? conversionType);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion(Type providerClrType);
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 (conversionType As Type) As PropertyBuilder
Public Overridable Function HasConversion (providerClrType As Type) As PropertyBuilder

参数

providerClrTypeconversionType
Type

要转换到和传出的类型。

返回

同一个生成器实例,以便可以链接多个配置调用。

适用于

HasConversion(ValueConverter, ValueComparer)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便使用给定 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)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便使用给定 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)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

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>()

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

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>()

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

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)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

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>()

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion>();
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TProvider>();
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasConversion(Of TConversion) () As PropertyBuilder
Public Overridable Function HasConversion(Of TProvider) () As PropertyBuilder

类型参数

TConversion TProvider

要转换到的类型或从 ValueConverter中继承的类型。

返回

同一个生成器实例,以便可以链接多个配置调用。

适用于

HasConversion<TConversion>(ValueComparer)

Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs
Source:
PropertyBuilder.cs

配置属性,以便在写入数据库之前转换属性值,并在从数据库读取时重新转换。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TConversion>(Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasConversion<TProvider>(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 TConversion) (valueComparer As ValueComparer) As PropertyBuilder
Public Overridable Function HasConversion(Of TProvider) (valueComparer As ValueComparer) As PropertyBuilder

类型参数

TConversion TProvider

要转换到的类型或从 ValueConverter中继承的类型。

参数

valueComparer
ValueComparer

转换前要用于值的比较器。

返回

同一个生成器实例,以便可以链接多个配置调用。

适用于