Extension for teams using dependency injection via constructor arguments (for example, in ASP MVC). Also, an example of Roslyn refactoring extension that is just the right sizes to learn Roslyn - beyond "Hello world" (does something usefull), but small enough to check it out in under an hour. Use case: You've added several new dependency fileds/properties to your class and now you need to go to constructor, add arguments for them and add assignments. With this extension, you need only click on the class name and select "(Re)Generate dependency injected constructor". Extension will locate your one public sonstructor and add the right things. All existing code will be preserverd. If you have more than one constructor - you can use an attribute to mark the right one. All private readonly fields that are not already set in constructor will be treated as injectables and injected. You can also choose a particular constructor to be used by clicking on it. |