Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullable DateTime issue with SQLite #10027

Closed
SamuelLioult opened this issue Oct 10, 2017 · 5 comments
Closed

Nullable DateTime issue with SQLite #10027

SamuelLioult opened this issue Oct 10, 2017 · 5 comments

Comments

@SamuelLioult
Copy link

I have an issue with a nullable DateTime. I create an instance of a model which contains a nullable DateTime. When I want to update the datetime value in te database, the saved value is always 01/01/0001 in the SQLite database. This issue only appears in RELEASE mode but not in DEBUG mode.

If you are seeing an exception, include the full exceptions details (message and stack trace).

I describe my issue here with a sample code to reproduce the issue.

Further technical details

EF Core version: Microsoft.EntityFrameworkCore.SQLite 1.1.2
Database Provider: Microsoft.EntityFrameworkCore.SQLite
Operating system: Windows 10 15063.608
IDE: Visual Studio 2017

@ajcvickers
Copy link
Member

@SamuelLioult Is this a UWP app?

@ajcvickers
Copy link
Member

@SamuelLioult Never mind--I see that it is from the link. It could be an issue with .NET Native, and may already be fixed in 2.0. We will investigate.

@SamuelLioult
Copy link
Author

@ajcvickers Yes it is a UWP app

@ajcvickers ajcvickers added this to the 2.1.0 milestone Oct 11, 2017
@AndriySvyryd
Copy link
Member

This is fixed in 2.0.3/2.0.1 with UWP 6

To try out the pre-release patch, please refer to the following guide:

@dahovey
Copy link

dahovey commented Dec 6, 2017

Are there any possible workarounds for this issue, with using version 1.1.4 of EF Core?

Since using version 2.x of EF Core with UWP requires the Windows Fall update this isn't possible with the project I'm working on.

The only possible workaround I can think is to use Raw Sql to insert or update entity that has any nullable DateTime/DateTimeOffset values. Is there anything that can be overridden by a consumer to fix the issue?

@ajcvickers ajcvickers removed this from the 2.1.0-preview1 milestone Apr 26, 2018
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants