Skip to content

Implement DbSet.Find #5800

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

Merged
merged 1 commit into from
Jun 17, 2016
Merged

Implement DbSet.Find #5800

merged 1 commit into from
Jun 17, 2016

Conversation

ajcvickers
Copy link
Contributor

Issue #797

Semantics are essentially the same as EF6:

  • If entity with given key is being tracked, then return it without a database query
  • Otherwise, query the database and track and return entity if found
  • Otherwise, return null

@@ -0,0 +1,312 @@
// Copyright (c) .NET Foundation. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't verify the SQL here unless there is a meaningful difference from SQL Server. We removed this type of verification because it added a significant maintenance burden to query.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also a way of ensuring that the database has/has not been hit. Okay if I change it to empty string verses not empty string?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't you already getting that verification by using Assert.Same?

@anpete
Copy link
Contributor

anpete commented Jun 16, 2016

:shipit:

Issue #797

Semantics are essentially the same as EF6:
- If entity with given key is being tracked, then return it without a database query
- Otherwise, query the database and track and return entity if found
- Otherwise, return null
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.

5 participants