Copy and reinsert an entity

Posts   
 
    
GunnarIF
User
Posts: 13
Joined: 29-May-2008
# Posted on: 12-Feb-2009 18:44:10   

Hi! Is it possible somehow to fetch an entity, mark it as new and then save?

Example:


MyEntity entity = new MyEntity(ID);
Adapter.FetchEntity(entity);
entity.IsNew = true;
entity.ID = 0;
Adapter.SaveEntity(entity);

So this would make a copy of my entity in the database.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 12-Feb-2009 21:07:15   

It certainly is - please see this thread.

Matt