Skip to content

Exclude primitive id property from INSERT if it is set to 0 (zero) #402

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

Closed
mp911de opened this issue Jul 17, 2020 · 1 comment
Closed

Exclude primitive id property from INSERT if it is set to 0 (zero) #402

mp911de opened this issue Jul 17, 2020 · 1 comment
Labels
type: enhancement A general enhancement

Comments

@mp911de
Copy link
Member

mp911de commented Jul 17, 2020

Our IsNewStrategy considers entities new if the Id is either null or if the Id property is primitive and its value is 0 (zero). We should omit these properties to avoid the need for either wrapper types or failures such as with SQL Server that requires identity insert to be enabled.

@mp911de
Copy link
Member Author

mp911de commented Aug 4, 2020

Waiting for #368.

@mp911de mp911de added status: blocked An issue that's blocked on an external project change and removed status: blocked An issue that's blocked on an external project change labels Aug 4, 2020
mp911de added a commit that referenced this issue Aug 5, 2020
We now exclude Id properties from being used in the INSERT field list if the Id value is zero and of a primitive type or if the value is null using a numeric wrapper type.
@mp911de mp911de closed this as completed Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant