Actually I am doing a list as a reference parameter as follows:
public static List ListMethod(List result)
I saw some people doing in this way too:
public static void ListMethod(ref List result)
If I'm not wrong, "my" method also takes the list
as reference parameter, and you should be able to use it just the same way as "other" does in his method.
But it seems more "clean" to me that you enter a parameter, do something with it and return it in the methods return value.
Any good arguments for or against one method or the other?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…