I've come across code in this format quite regularly.. (And I guess I'm nitpicking) I know, classB can be labeled as ref/out. I'm asking from a viewpoint of if going by good/best practices, or am I misunderstanding the point of ref/out.
The reason I'm asking is, that I'm finding it confusing at times not knowing if properties in my object is going to be updated or not :/ (Meaning id need to drill down into the method to see whats going on)
public ClassB GetSomething()
{
var classB = new ClassB();
ClassA classA = .... // some code to get new obj
//from a glance i'm not ale to tell that classB gets updated/assigned to
this.DoSomething(classA , classB);
return classB;
}
private void DoSomething(ClassA classA, ClassB classB)
{
classB.Property = classA.something.Property;
}