c# - How to resolve Lambda Expression -


hello working on 1 project setting log4net settings of linq . when assign function lambda expression gives me error.

icollection myconfiguration.configurelog4net(string processname)       {           //my custom code           return log4net.config.xmlconfigurator.configure(log4netconfigelement);       } 

my calling code :

nservicebus.setlogginglibrary.log4net(() => myconfiguration.configurelog4net("mylog")); // error here 

over here error:

cannot convert lambda expression type nservicebus.configure because not delegate type

can tell me how resolve ?

ok, think works:

nservicebus.setlogginglibrary.log4net((action)(() => myconfiguration.configurelog4net("mylog")));  

or

nservicebus.setlogginglibrary.log4net(new action(() => myconfiguration.configurelog4net("mylog")));  

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -