Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetCopy ObjectContext ?

  • Freitag, 3. Juli 2009 09:27Graham Hay TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    Hi,
    is it feasible to make a functioning copy an ObjectContext with its ObjectStateManager state and tracked entities,
    and if so, what is a good way to do this ?

    Many thanks
    Graham

Antworten

  • Samstag, 4. Juli 2009 07:42Daniel Simmons - MSFTBesitzerTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    It is possible to do this, but I wouldn't say that it's really feasible.  There's nothing in the box to do it.  If you wanted to write the code yourself, you would need to iterate over the information in the source ObjectStateManager and then recreate things in the target.  The trick is recreating the original values and such which is harder than it looks on the surface.

    - Danny
    This posting is provided "AS IS" with no warranties, and confers no rights.

Alle Antworten

  • Samstag, 4. Juli 2009 07:42Daniel Simmons - MSFTBesitzerTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    It is possible to do this, but I wouldn't say that it's really feasible.  There's nothing in the box to do it.  If you wanted to write the code yourself, you would need to iterate over the information in the source ObjectStateManager and then recreate things in the target.  The trick is recreating the original values and such which is harder than it looks on the surface.

    - Danny
    This posting is provided "AS IS" with no warranties, and confers no rights.