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

BulkInsertOrUpdate doesn't return Identity when no insert or update happen #1503

Open
ksbecker opened this issue May 29, 2024 · 0 comments
Open

Comments

@ksbecker
Copy link

I have a table of recipient addresses. I only want to insert an address once so I'm using the BulkInsertOrUpdate method and am specifying the columns to check against deduping in the BulkConfig. I don't have any other properties that would change as a result. However I want to get back all of the addresses with their identity regardless of whether they were updated or inserted. Below is the call to the method. Is there a better way of handling this?

dataContext.BulkInsertOrUpdate(recipients, new BulkConfig
{
    UpdateByProperties = ["Address1", "Address2", "City", "State", "Zip5"],
    SetOutputIdentity = true,
});
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

1 participant