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
Post a Comment