I see sometimes method that has a parameter, modifies it and returns it.
Is there any advantage of that, why no simply pass the parameter by ref and keep the method by ref
?
Here is what I see:
public MyClass DoSomething(MyClass myClass)
{
myClass.Amount = 500;
return myClass;
}
Why not keep it simple like this:
public void DoSomething(ref MyClass myClass)
{
myClass.Amount = 500;
}