Attach Entity

Mar 3, 2015 at 10:47 AM
Is there any way to attach a entity from one session to another?

I sometimes need to copy entities from on database to another and i see no way in VITA to do this, if the object is new, session.NewEntity gives me a new entity and i copy the properties, but if it is already in the database i do not see any option.

Mar 3, 2015 at 4:52 PM
EntitySession (class, not interface) has method Attach(EntityRecord record);
to get entity record, use EntityHelper.GetRecord(ent) method. Try this, should work, just case session interface instance to class, get record for entity, and call attach