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

Used cached entity for comparison #141

Open
bzuillsmith opened this issue Jun 15, 2015 · 2 comments
Open

Used cached entity for comparison #141

bzuillsmith opened this issue Jun 15, 2015 · 2 comments

Comments

@bzuillsmith
Copy link

I can sometimes cache the unchanged state of an entity from the db. I tried attaching it to the context just before UpdateChanges but GraphDiff still queries the db. How would I make GraphDiff use the attached version instead of requerying it from the db?

@sundeepyama
Copy link

Hi bzuillsmith

You can pass the persisted entity from the db to Merge method in GraphDiffer.cs file.

See the highlighted section in the below image. If you pass in the persisted object which is attached to context then GraphDiff shouldn't query again.

image

@bzuillsmith
Copy link
Author

Indeed. Except that GraphDiffer is internal. So it would require modifying some other files as well. I may put the effort into a pull request if it seems like a reasonable solution to @refactorthis

@ghost ghost added the enhancement label Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants