Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot convert int to long

I created DB for one website and everything was working fine. For some reasons, I had to downgrade from .Net Core 6 to .Net 5 and now I’m getting errors in migration files.
Screenshot of errors

How to solve this problem?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In EF Core 6, there are overloads for both Int32 and Int64 parameters of the UseIdentityColumns method. In EF Core 5, there is only one for Int32. So as mentioned in the comments, you need to change 1L to simply 1.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading