BACKGROUND
I'm having some trouble with updating an entity in EF. I keep getting this error:
"An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key"
I am fully aware that there is obviously another entity somewhere that is attached. However, I currently cannot track it down. There is a lot of code and I've spent quite some time on it already. As far as I can see, I am using the AsNoTracking()
extension method on all my queries.
WHAT I NEED
My question is this: Is there any way I can see what is actually in the ObjectStateManager at any given time? If I can see the items in there during debugging, I can more quickly track down where this is coming from.
If the above is not possible, I would appreciate any advice on how best to tackle this problem.. it's like a needle in a haystack right now.