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

InsertOrUpdate doesn't work for unchanged entities #18

Open
Itzalive opened this issue May 7, 2020 · 0 comments · May be fixed by #36
Open

InsertOrUpdate doesn't work for unchanged entities #18

Itzalive opened this issue May 7, 2020 · 0 comments · May be fixed by #36

Comments

@Itzalive
Copy link

Itzalive commented May 7, 2020

In InMemoryEngine the Save will return the number of entities that already exist and updates them where necessary. In SQLEngine the Save will return the number of entities to be updated. In the case where the item exists but doesn't need to be updated InMemoryEngine returns 1 and SQLEngine returns 0. The 0 returned from SQLEngine then prompts the Insert.

Save() return values:

                 | Exists no change | Exists change needed | Does not exist
InMemoryEngine   |       1          |           1          |         0
SQLEngine        |       0          |           1          |         0

Save() != Exists() in SQLEngine is there a better method to check whether something already exists in InsertOrUpdate() or should Save() change so that is is synonymous with exists.

Either way InMemoryEngine and SQLEngine should give the same results.

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

Successfully merging a pull request may close this issue.

1 participant