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

Get by id creates empty predicate. #314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kspdrgn
Copy link

@kspdrgn kspdrgn commented Feb 20, 2023

The test case on master currently works because there is only 1 row in the database, so select without a where returns 1 row as expected.

Added breaking test case for SQL Server Get, though this bug may affect all providers.

The predicate is not filled out when using Get(value) but they work when using Get(object). I noticed that in DapperImplementor.GetMapAndPredicate, GetKeyPredicate is only called for Update and Delete, not Get.

This pull request does not fix anything, it will start to fail the build because this is a bug.

Workaround for developers trying to use Get is to use Get(new {}) syntax.

Workaround for Dapper-Extensions is to fix the documentation to say Get(new { id }) instead of Get(id).

… all providers. Predicate is not filled out when using Get(value) but they work when using Get(object). I noticed that in `DapperImplementor.GetMapAndPredicate`, GetKeyPredicate is only called for Update and Delete, not Get.
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 this pull request may close these issues.

1 participant