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

When inserting entity with int? Id assigned a value other than null, the assigned value is returned instead of the inserted entity's Id #254

Open
AEZ314 opened this issue Oct 14, 2021 · 1 comment

Comments

@AEZ314
Copy link

AEZ314 commented Oct 14, 2021

The issue is well explained in the title. I'm using the latest version. The expected behaviour is for the Insert extension method to return the newly inserted entity's Id. My Id property has [Key], [IgnoreInsert] and [IgnoreUpdate]. Btw I noticed the issue when trying to duplicate rows. I first fetch a row, change a specific column and insert it as a new entry. When I set the Id to null I get the expected newly inserted entity's Id.

@joshuajrrc
Copy link

yeah. looks like a value of 0 or Nothing gets it to work. I just upgraded an app to a newer version today. Previously I had used -1 in the ID of my object to signify a new record. Had to update everything to use 0.

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