Skip to content

Instantly share code, notes, and snippets.

@carcer
Created April 19, 2011 10:19
Show Gist options
  • Save carcer/927095 to your computer and use it in GitHub Desktop.
Save carcer/927095 to your computer and use it in GitHub Desktop.
container.Register(Component.For<SameSaveListener>().AsNHibernateListener(ListenerType.SaveUpdate).For("factory name"))
or
container.Register(NHibernateListener.Of<SameSaveListener>(ListenerType.SaveUpdate).For("factory name"))
.For is optional, if it's supplied, it will be applied to that factory, if not, it is applied to
all. Listeners will be registered as singletons (?)
RegisterListenerType<ISaveOrUpdateEventListener>(ListenerType.SaveUpdate);
RegisterListenerType<ISaveOrUpdateEventListener>(ListenerType.Save);
RegisterListenerType<IPostInsertEventListener>(ListenerType.PostInsert);
RegisterListenerType<IPostUpdateEventListener>(ListenerType.PostUpdate);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment