views:

133

answers:

0

I need to Inject some global service (daoFactory) into EventListenet subscribed on PostUpdate event. I`ve read that it is possible to do this way:

public class YourPostInsertListener : IPostInsertEventListener
{
private readonly IPersistentAuditor auditor;

public YourPostInsertListener(IPersistentAuditor auditor)
{
    this.auditor = auditor;
}

public void OnPostInsert(PostInsertEvent @event)

But this code just throws exception: no parameterless constructor was specified for EventListener. And this is understandable behavior, because I haven`t added my service to any container. So how can I specify the IoC contauner in NHibernate?