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

EF trying to insert data into Genre when adding new movie details #300

Open
PratikG7529 opened this issue Oct 6, 2022 · 2 comments
Open

Comments

@PratikG7529
Copy link

Hi, when im trying to add details of new movie as per exercise in section 4, as part of _context.SaveChanges() the details of Genre table with new GenreId and type is getting added. Which then throws an error.

@PratikG7529
Copy link
Author

Addingnewmovie

@vc94
Copy link

vc94 commented Sep 2, 2023

This is because you are trying to pass value for primary key which was set identity at DB side. Try commenting the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants