roslynator
roslynator copied to clipboard
Refactoring a method signature for out parameters
It would be nice if you can provide a refactoring to replace one or more out parameters of a method to return them (and may be vice versa)
Please provide a code sample.
Something like:
public void Function(string inStr, out int out1, out DateTime out2)
{
...
}
to
public (int, DateTime) Function(string inStr)
{
int out1;
DateTime out2;
...
return (out1, out2);
}
I forgot to mention, I would like to it to make appropriate changes to its caller too.
This refactoring is available as "Transform Out Parameters" in ReSharper: https://www.jetbrains.com/help/resharper/Refactorings_Transform_Parameters.html