EntityFramework.Docs icon indicating copy to clipboard operation
EntityFramework.Docs copied to clipboard

Depth of Values of SetValues()

Open zanate4019 opened this issue 7 years ago • 1 comments

When using SetValues(), does EF only detect changes to the top level entity or does it walk the graph for navigation properties as well?

For example if I have disconnected entity that has several populated navigation properties and use SetValues to set the differences to a connected entity, do I need to null out my navigation properties (leaving the navigation foreign key) to prevent SetValues from changing the navigation properties as well?

Jason


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

zanate4019 avatar Mar 07 '19 21:03 zanate4019

@zanate4019 SetValues will not set navigation properties. It acts on a single entity instance.

ajcvickers avatar Mar 07 '19 23:03 ajcvickers