What you are looking for isvar collection = previousState[i] as NHibernate.Collection.IPersistentCollection; adaptedPreviousState[i] = collection.StoredSnapshot;
2009/5/11 Fabio Maulo <[email protected]> > You have a IPersistentCollection because without it, you can't do nothing.from > your post: > var collection = previousState[i] > as NHibernate.Collection.IPersistentCollection; > // CollectionSnapshot.Snapshot does not exist anymore > adaptedPreviousState[i] = collection.CollectionSnapshot.Snapshot; > > As you can see, you are casting an element of state's array to > a IPersistentCollection. > > Obviously using collection's listeners is more easy than use IIterceptor > (discontinued interface). > > > 2009/5/11 Stefan Steinegger <[email protected]> > > >> Thanks. Both need a "Persister" as argument, and I don't have one. >> >> I need it in a Interceptor. It fires events with "old value" and "new >> value" data. It worked well in NH 2.0. >> >> On 11 Mai, 17:21, Fabio Maulo <[email protected]> wrote: >> > or /// <summary> >> > /// Return a new snapshot of the current state of the collection >> > /// </summary> >> > ICollection GetSnapshot(ICollectionPersister persister); >> > >> > it depend on what you are doing with it >> > >> > 2009/5/11 Fabio Maulo <[email protected]> >> > >> > >> > >> > > IPersistentCollection.StoredSnapshot >> > >> > > 2009/5/11 Stefan Steinegger <[email protected]> >> > >> > >> Hello. I'm trying to get version 2.1 working on our codebase. I >> > >> couldn't get my AuditTrail implementation working, because there are >> > >> changes on NH's collections. >> > >> > >> I get the collection's "old-value" like in this implementation from >> > >> jr76: >> > >> > >> >> http://groups.google.com.ar/group/nhusers/browse_thread/thread/8e7f1f... >> > >> > >> This part does not compile anymore: >> > >> > >> var collection = previousState[i] as >> > >> NHibernate.Collection.IPersistentCollection; >> > >> // CollectionSnapshot.Snapshot does not exist anymore >> > >> adaptedPreviousState[i] = collection.CollectionSnapshot.Snapshot; >> > >> > >> How can I get the "previous state" of the collection with NH 2.1? >> > >> Thanks a lot for any hint. >> > >> > > -- >> > > Fabio Maulo >> > >> > -- >> > Fabio Maulo >> >> >> > > > -- > Fabio Maulo > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
