Generally what I consider a better way is to return an object that contains all of the outputs you need. That may be a better solution for what you are looking for, cannot be sure.
private struct ReturnedObject
{
public ReturnedObject(string variable1, string variable2)
{
Variable1 = variable1;
Variable2 = variable2;
}
public string Variable1;
public string Variable2;
}
private ReturnedObject SomeMethod ()
{
return new ReturnedObject("first value", "second value");
}
There are exceptions, but C# is an object oriented language and should be using objects. I also prefer objects as arguments, otherwise some calls can become very long. The exeception to this would be where I am doing something like
TryParse