QDev.CSharp.EFCore.Converters
1.0.1
dotnet add package QDev.CSharp.EFCore.Converters --version 1.0.1
NuGet\Install-Package QDev.CSharp.EFCore.Converters -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="QDev.CSharp.EFCore.Converters" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QDev.CSharp.EFCore.Converters --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: QDev.CSharp.EFCore.Converters, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install QDev.CSharp.EFCore.Converters as a Cake Addin #addin nuget:?package=QDev.CSharp.EFCore.Converters&version=1.0.1 // Install QDev.CSharp.EFCore.Converters as a Cake Tool #tool nuget:?package=QDev.CSharp.EFCore.Converters&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Entity Framework Core Converters
This library offers a range of custom converters that can be integrated into Entity Framework Core through the overriding of the ConfigureConventions method. These converters enable flexible and personalized data transformation between database data types and application data types.
Table of Contents
Installation
Using the NuGet package manager console within Visual Studio run the following command:
Install-Package QDev.CSharp.EFCore.Converters
Or using the .NET Core CLI from a terminal window:
dotnet add package QDev.CSharp.EFCore.Converters
Converters
Converters | Description |
---|---|
TimeOnlyConverter |
Performs bidirectional conversion between the TimeOnly and TimeSpan types to enable Entity Framework Core compatibility with the TimeOnly struct. |
DateOnlyConverter |
Performs bidirectional conversion between the DateOnly and DateTime types to enable Entity Framework Core compatibility with the DateOnly struct. |
Integrating the converters
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
configurationBuilder.Properties<TimeOnly>().HaveConversion<TimeOnlyConverter>().HaveColumnType("time");
configurationBuilder.Properties<DateOnly>().HaveConversion<DateOnlyConverter>().HaveColumnType("date");
// add converters as you need
base.ConfigureConventions(configurationBuilder);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Microsoft.EntityFrameworkCore (>= 7.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
fix documentation