ElementTypeBuilder.HasConversion Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasConversion(ValueConverter) |
Configures elements of the collection so that their values are converted to and from the database using the given ValueConverter. |
HasConversion(Type) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion(ValueConverter, ValueComparer) |
Configures elements of the collection so that their values are converted before using the given ValueConverter. |
HasConversion(Type, ValueComparer) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion(Type, Type) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion<TConversion,TComparer>() |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion<TConversion>() |
Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database. |
HasConversion<TConversion>(ValueComparer) |
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database. |
HasConversion(ValueConverter)
Configures elements of the collection so that their values are converted to and from the database using the given ValueConverter.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion (Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter? converter);
abstract member HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion (converter As ValueConverter) As ElementTypeBuilder
Parameters
- converter
- ValueConverter
The converter to use.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion(Type)
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion (Type? conversionType);
abstract member HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
override this.HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion (conversionType As Type) As ElementTypeBuilder
Parameters
- conversionType
- Type
The type to convert to and from or a type that inherits from ValueConverter.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion(ValueConverter, ValueComparer)
Configures elements of the collection so that their values are converted before using the given ValueConverter.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder 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.ElementTypeBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion (converter As ValueConverter, valueComparer As ValueComparer) As ElementTypeBuilder
Parameters
- converter
- ValueConverter
The converter to use.
- valueComparer
- ValueComparer
The comparer to use for values before conversion.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion(Type, ValueComparer)
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion (Type conversionType, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
override this.HasConversion : Type * Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion (conversionType As Type, valueComparer As ValueComparer) As ElementTypeBuilder
Parameters
- conversionType
- Type
The type to convert to and from or a type that inherits from ValueConverter.
- valueComparer
- ValueComparer
The comparer to use for values before conversion.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion(Type, Type)
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion (Type conversionType, Type? comparerType);
abstract member HasConversion : Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
override this.HasConversion : Type * Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion (conversionType As Type, comparerType As Type) As ElementTypeBuilder
Parameters
- conversionType
- Type
The type to convert to and from or a type that inherits from ValueConverter.
- comparerType
- Type
A type that inherits from ValueComparer.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion<TConversion,TComparer>()
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion<TConversion,TComparer> () where TComparer : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer;
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder (requires 'Comparer :> Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer)
Public Overridable Function HasConversion(Of TConversion, TComparer) () As ElementTypeBuilder
Type Parameters
- TConversion
The type to convert to and from or a type that inherits from ValueConverter.
- TComparer
A type that inherits from ValueComparer.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion<TConversion>()
Configures elements of the collection so their values are converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion<TConversion> ();
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion(Of TConversion) () As ElementTypeBuilder
Type Parameters
- TConversion
The type to convert to and from or a type that inherits from ValueConverter.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion<TConversion>(ValueComparer)
Configures elements of the collection so that their values are converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder HasConversion<TConversion> (Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer? valueComparer);
abstract member HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
override this.HasConversion : Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer -> Microsoft.EntityFrameworkCore.Metadata.Builders.ElementTypeBuilder
Public Overridable Function HasConversion(Of TConversion) (valueComparer As ValueComparer) As ElementTypeBuilder
Type Parameters
- TConversion
The type to convert to and from or a type that inherits from ValueConverter.
Parameters
- valueComparer
- ValueComparer
The comparer to use for values before conversion.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
Visszajelzés
https://aka.ms/ContentUserFeedback.
Hamarosan elérhető: 2024-ben fokozatosan kivezetjük a GitHub-problémákat a tartalom visszajelzési mechanizmusaként, és lecseréljük egy új visszajelzési rendszerre. További információ:Visszajelzés küldése és megtekintése a következőhöz: