Qrtix.EFCore.Converters 1.0.0

dotnet add package Qrtix.EFCore.Converters --version 1.0.0                
NuGet\Install-Package Qrtix.EFCore.Converters -Version 1.0.0                
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="Qrtix.EFCore.Converters" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Qrtix.EFCore.Converters --version 1.0.0                
#r "nuget: Qrtix.EFCore.Converters, 1.0.0"                
#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 Qrtix.EFCore.Converters as a Cake Addin
#addin nuget:?package=Qrtix.EFCore.Converters&version=1.0.0

// Install Qrtix.EFCore.Converters as a Cake Tool
#tool nuget:?package=Qrtix.EFCore.Converters&version=1.0.0                

Entity Framework Core Converters

NuGet Version GitHub Repo stars

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.

Consult the online documentation for more details.

Table of Contents

Installation

NuGet Package Manager

  1. Open your project in Visual Studio.
  2. Right-click on your project in Solution Explorer.
  3. Select "Manage NuGet Packages..."
  4. Search for "Qrtix.EFCore.Converters" in the NuGet Package Manager.
  5. Click on "Install" to add the package to your project.

.NET CLI

You can also install Qrtix.EFCore.Converters using the .NET CLI:

dotnet add package Qrtix.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);
}

Contributing

Did you find a bug?

  • Ensure the bug was not already reported by searching on GitHub under Issues.
  • If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring.

Did you write a patch that fixes a bug?

  • Open a new GitHub pull request with the patch.
  • Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

Do you intend to add a new feature or change an existing one?

  • First suggest your change in the EFCore ideas page for discussion.
  • There are no fixed rules on what should and shouldn't be in this library, but some features are more valuable than others, and some require long-term maintenance that outweighs the value of the feature. So please get sign-off from the project leader (Carlos J. Ortiz) before putting in an excessive amount of work.

Do you have questions about the source code?

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  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 is compatible.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 128 4/21/2024

First Realese