To replace a constructor with a factory method
- In the editor, place the caret at a constructor.
ReSharper | Refactor | Replace Constructor with Factory Method. The Replace Constructor with Factory Methoddialog box opens:
Factory method nametext box, specify a name for the new factory method.
In classdrop-down list, specify the fully qualified name of the class that the factory method should instantiate.
Next. If no conflicts are found, the refactoring is applied immediately. Otherwise, resolve conflicts.