ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly
7.0.0-preview.1
Prefix Reserved
See the version list below for details.
dotnet add package ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly --version 7.0.0-preview.1
NuGet\Install-Package ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly -Version 7.0.0-preview.1
<PackageReference Include="ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly" Version="7.0.0-preview.1" />
<PackageVersion Include="ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly" Version="7.0.0-preview.1" />
<PackageReference Include="ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly" />
paket add ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly --version 7.0.0-preview.1
#r "nuget: ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly, 7.0.0-preview.1"
#:package ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly@7.0.0-preview.1
#addin nuget:?package=ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly&version=7.0.0-preview.1&prerelease
#tool nuget:?package=ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly&version=7.0.0-preview.1&prerelease
ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly
Adds .NET 6 or later DateOnly
and TimeOnly
support to the SQL Server EF Core 6 provider. These types map directly to the SQL Server date
and time
data types.
Installation
The latest version is available on NuGet.
dotnet add package ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly
Compatibility
The following table show which version of this library to use with which version of EF Core.
EF Core | Version to use |
---|---|
6.0 | 6.0.x |
7.0 | 7.0.x |
Usage
Enable DateOnly and TimeOnly support by calling UseDateOnlyTimeOnly inside UseSqlServer. UseSqlServer is is typically called inside Startup.ConfigureServices
or OnConfiguring
of your DbContext type.
options.UseSqlServer(
connectionString,
x => x.UseDateOnlyTimeOnly());
Add DateOnly
and TimeOnly
properties to your entity types.
class EventSchedule
{
public int Id { get; set; }
public DateOnly StartDate { get; set; }
public TimeOnly TimeOfDay { get; set; }
}
Insert data.
dbContext.AddRange(
new EventSchedule { StartDate = new DateOnly(2022, 12, 24), TimeOfDay = new TimeOnly(12, 00) };
dbContext.SaveChanges();
Query.
var eventsOfTheDay = from e in dbContext.EventSchedules
where e.StartDate == new DateOnly(2022, 10, 12)
select e;
See also
Product | Versions 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 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Data.SqlClient (>= 5.1.0-preview2.22314.2)
- Microsoft.EntityFrameworkCore.SqlServer (>= 7.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly:
Package | Downloads |
---|---|
LykkeBiz.Common.MsSql
Microsoft SQL server EF Core DBContext with Lykke specific |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
7.0.10 | 125,882 | 6/3/2024 |
7.0.9 | 33,481 | 5/8/2024 |
7.0.8 | 69,756 | 1/31/2024 |
7.0.7 | 8,596 | 1/11/2024 |
7.0.6 | 27,701 | 12/12/2023 |
7.0.5 | 194,753 | 6/9/2023 |
7.0.4 | 16,011 | 5/11/2023 |
7.0.4-preview1 | 211 | 5/9/2023 |
7.0.3 | 13,362 | 4/19/2023 |
7.0.2 | 16,737 | 4/4/2023 |
7.0.1 | 139,294 | 1/27/2023 |
7.0.0 | 2,959 | 1/20/2023 |
7.0.0-preview.3 | 3,218 | 12/14/2022 |
7.0.0-preview.2 | 173 | 12/9/2022 |
7.0.0-preview.1 | 496 | 12/6/2022 |
6.0.11 | 3,148 | 10/6/2024 |
6.0.10 | 15,124 | 6/3/2024 |
6.0.9 | 1,175 | 5/8/2024 |
6.0.8 | 20,482 | 1/31/2024 |
6.0.7 | 825 | 1/11/2024 |
6.0.6 | 7,581 | 12/12/2023 |
6.0.5 | 23,829 | 6/9/2023 |
6.0.4 | 2,819 | 5/11/2023 |
6.0.4-preview1 | 200 | 5/9/2023 |
6.0.3 | 8,448 | 4/19/2023 |
6.0.2 | 1,773 | 4/4/2023 |
6.0.1 | 174,064 | 1/27/2023 |
6.0.0 | 1,822 | 1/20/2023 |
6.0.0-preview.3 | 2,678 | 12/14/2022 |
6.0.0-preview.2 | 151 | 12/9/2022 |
6.0.0-preview.1 | 1,008 | 12/6/2022 |