GraphDiff icon indicating copy to clipboard operation
GraphDiff copied to clipboard

Used cached entity for comparison

Open bzuillsmith opened this issue 9 years ago • 2 comments

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?

bzuillsmith avatar Jun 15 '15 18:06 bzuillsmith

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

sundeepyama avatar Jun 17 '15 20:06 sundeepyama

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

bzuillsmith avatar Jun 18 '15 19:06 bzuillsmith