skrishna
skrishna

Reputation: 51

How to add a SaveOrUpdateCopy event listener in NHibernate

How can I add a event listener for SaveOrUpdateCopy in NHibernate ? I see that the ListenerType enumeration does not have a 'SaveOrUpdateCopy' type. I tried using the 'Merge' type, but that adds it to the MergeEventListeners collection. The SaveOrUpdateCopy invokes the events from the SaveOrUpdateCopyEventListeners collection.

How can I add my event class to the SaveOrUpdateCopyEventListeners collection in NHibernate?

Upvotes: 4

Views: 346

Answers (1)

Kronos
Kronos

Reputation: 3111

On our project :

listeners.SaveOrUpdateEventListeners = new ISaveOrUpdateEventListener[] 
    { new TrackChangeFlushEntityEventListener(),
      new DefaultSaveOrUpdateEventListener() 
    };

works for SaveOrUpdateCopy

Upvotes: 1

Related Questions