ReSharper Web Help

The Transform Out Parameters refactoring lets you get rid of out parameters in methods and consequently improves readability of your code.

To transform out parameters
  1. Place the caret at the name of a method, at the out keyword or at the name of an out parameter in the editor or select the method in the File Structure window.
  2. Do one of the following:
    • On the main menu, choose ReSharper | Refactor | Transform Out Parameters.
    • Right-click, then click Refactor | Transform Out Parameters on the context menu.
    • Press Ctrl+Shift+R, then click Transform Out Parameters.
  3. The Transform Out Parameters dialog box opens:

    Select the appropriate check boxes nearby the parameters. According to the selected check boxes, a new signature is displayed in the Transform to text area.
  4. Click Next.

After applying the refactoring two kinds of results are possible:

  • If the return type of a method is void and only one out parameter is being transformed, ReSharper changes the method so that it simply returns the value of this parameter.
  • If the return type of a method is not void or more than one out parameter are being transformed, ReSharper uses the Tuple type.


Pay attention, that in projects targeting .NET Framework 3.5 or lower this refactoring is available only for methods with a void return type.

See Also