-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Invalid cast when calling SaveChanges() #19174
Comments
Duplicate of #16812, see also the breaking change note. tl;dr you need to reference Microsoft.Data.SqlClient instead of System.Data.SqlClient. |
Thanks for pointing that out, I was about to note that changing the column definition I've updated to use Is it safe / possible to use |
@LordBenjamin I'm not familiar with LINQ-to-SQL, although I'm guessing it may not be possible for it to work with Microsoft.Data.SqlClient. However, it should be OK to have the same application with EF Core using M.D.SqlClient, and L2S using S.D.SqlClient. As a general rule M.D.SqlClient is very compatible with S.D.SqlClient, and since it's more actively developed, it will contain more fixes and features as time goes on. |
Called
SaveChanges()
after adding a simple entity.Expected entity to be saved - actually got an exception.
Steps to reproduce
I haven't put together a minimum repro yet, but my method essentially looks like this:
Inner exception:
Further technical details
EF Core version: 3.1.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Framework 4.7.2
Operating system: Windows 10 (1809)
IDE: Visual Studio 2019 16.3
The text was updated successfully, but these errors were encountered: