c# - Dependency injection through method with Resharper or DevExpress -


i want inject dependency in 1 of class , don't know if there refactor in tools resharper or devexpress that.

here class:

   public class classwithinjections    {       private dependency _fieldinjected;    }     public class dependency    {     } 

and final result want like: (note field can initialized method initialize)

   public class classwithinjections    {       private dependency _fieldinjected;        public void initialize(dependency fieldinjected)       {          _fieldinjected = fieldinjected;       }    } 

i want able activate refactor option while specifying field mouse cursor , tool suggest me if want inject dependency method, property or constructor.

with resharper, can 'encapsulate field' (ctrl+shift+r) or creating constructor code generation tool (alt-insert) don't found option inject dependency 'method' technique.

anybody have solution?

you can use devexpress refactor! pro > create setter method refactoring option purpose.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -