public override ICollection GetSnapshot(ICollectionPersister persister) { EntityMode entityMode = Session.EntityMode; // NH Different behavior : for NH-1810 and the way is working the possible underlining collection // the Snapshot is represented using a List<T> // (perhaps it has less performance then IDictionary but it is working) // TODO : should use ever underlining collection type or something to have same performace and same order var clonedSet = new SetSnapShot <object>(set.Count); foreach (object current in set) { object copied = persister.ElementType.DeepCopy(current, entityMode, persister.Factory); clonedSet.Add(copied); } return(clonedSet); }
public override ICollection GetOrphans(object snapshot, string entityName) { var sn = new SetSnapShot <object>((IEnumerable <object>)snapshot); return(GetOrphans(sn, set, entityName, Session)); }