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 t
Sure. Assuming _configuration
is going to store what you were using in your first bit of code. It should look something like this:
return Fluently.Configure().ExposeConfiguration(c => {
c.EventListeners.PostInsertEventListeners = _configuration;
c.EventListeners.PostUpdateEventListeners = _configuration;});
If there are any kind of cast errors from the compiler, you can always use:
_configuration.Cast<IPostInsertEventListeners>();
A lambda expression is just a delegate that often maps to one of the Func<T1, T2, ..., TResult>
variants.
Func<T1, TResult> myVar = c => _configuration = c;
Replacing TResult
and T1
with the relevant types.
That might work for you.
TResult matchDuplicates (T1 c) => _configuration = c;