dependency injection - How can I get Castle Windsor to automatically inject a property? -


I have a property on my classes for the logging service.

  Private ILogger logger = NullLogger .Instance; Public illogger logger {return logger; } Set {logger = value; }}  

and I have this component in registration:

  container.edffiliate  

However, Windsor does not inject the logger - am I missing something?

The lambda parameter for AddFacility is actually a creation callback (it is called when the function is not ), Not a factory

Use it instead:

  container.adfabiliti ("logging", new logging functionality (logar implementation.log 4 net, "path_to_lignet config"));  

BTW Windsor uses property dependency automatically, whenever it may happen.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -