I think my brain has become fried as i'm struggling to do something simple. In my application i have the following code to configure Nhibernate (my issue is not specific to Nhibernate).
return Fluently.Configure()
.ExposeConfiguration(c => {
c.EventListeners.PostInsertEventListeners = new IPostInsertEventListener[] { new LoggingEventListener() };
c.EventListeners.PostUpdateEventListeners = new IPostUpdateEventListener[] { new LoggingEventListener() };
});
However I need to store the configuration (the stuff inside ExposeConfiguration) inside a private variable. I can do the following:
return Fluently.Configure()
.ExposeConfiguration(c => _configuration = c);
Where _configuration is a private variable. But this doesn't add my extra configuration options (the EventListeners stuff). I've played around with various things but i guess my lambda knowledge isn't as good as i thought.
I'd appreciate your help. Thanks