TypeMappingConfigurationBuilder.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(Type) |
Configures the property so that the property value is converted before writing to the database and converted back when reading from the database. |
HasConversion<TConversion>() |
Configures the property so that the property value is converted before writing to the database and converted back when reading from the database. |
HasConversion(Type)
Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder HasConversion (Type conversionType);
abstract member HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
override this.HasConversion : Type -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
Public Overridable Function HasConversion (conversionType As Type) As TypeMappingConfigurationBuilder
Parameters
- conversionType
- Type
The type to convert to and from or a type that derives from ValueConverter.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
HasConversion<TConversion>()
Configures the property so that the property value is converted before writing to the database and converted back when reading from the database.
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder HasConversion<TConversion> ();
abstract member HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
override this.HasConversion : unit -> Microsoft.EntityFrameworkCore.Metadata.Builders.TypeMappingConfigurationBuilder
Public Overridable Function HasConversion(Of TConversion) () As TypeMappingConfigurationBuilder
Type Parameters
- TConversion
The type to convert to and from or a type that derives from ValueConverter.
Returns
The same builder instance so that multiple configuration calls can be chained.
Applies to
Entity Framework
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för