Deep Clone using Entity Framework

北战南征 提交于 2020-01-06 12:55:10

问题


How to create Deep Clone from objects returned via Entity Framework ? The source object also have some other collections associated with it. In other words, how to clone an entity returned from Entity Framework ?


回答1:


Just like how we deep clone any other objects. You need override the clone on source object and provide a implementation by copying each memberwise.

  • http://msdn.microsoft.com/en-us/library/system.object.memberwiseclone.aspx

  • How do you do a deep copy of an object in .NET (C# specifically)?



来源:https://stackoverflow.com/questions/5249633/deep-clone-using-entity-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!