-
Notifications
You must be signed in to change notification settings - Fork 9
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
ASP.NET Core Identity - InvalidCastException to DateTimeOffset #32
Comments
I was able to reproduce this. The trouble is around the DateTimeOffset type. Currently, we're mapping that to |
Thanks for your reply. Is this something that can't be easily fixed when using ADO.NET? A kludge is to add builder.Entity<ApplicationUser>().Ignore(x => x.LockoutEnd) to OnModelCreating method in ApplicationDbContext class. |
It can be fixed, but I think it requires some infrastructure in our EF project that we don't currently have built out, to cast/convert the types going between EF and ADO.NET. I'm probably not going to tackle this any time soon, but PRs are always welcome. |
I'm getting an exception when using the MySql provider with ASP.NET Core Identity. When I attempt to login I get "Unable to cast object of type DateTime to type DateTimeOffset" which I think is related to the LockoutEnd field in AspNetUsers table.
IdentityUser is defined at Microsoft.AspNetCore.Identity.EntityFrameworkCore/IdentityUser.cs. This was not a problem with "MySql.Data.EntityFrameworkCore": "7.0.6-IR31", but I'm getting the exception with "SapientGuardian.EntityFrameworkCore.MySql": "7.1.14".
The text was updated successfully, but these errors were encountered: