Entity Fremework serialization
- by Alexandr
Hello guys!
I was confused with my problem. I'm using Entity Framework and want to save entities on hard disk and then to restore them.
I have no problem with Serializing/Deserializing but i get an exception "The object cannot be added to the ObjectStateManager because it already has an EntityKey. Use ObjectContext.Attach to attach an object that has an existing key" when i try to add deserialized object to my datacontext.
And nothing happens when i just Attach my entity to datacontext
How to achieve my goal?
Thx in advance!
-Alexandr-