OOP best practice: Optional referenced-type paremeter

Published: 11/10/2019
OOP best practice: Optional referenced-type paremeter
Source: SOFTWAREENGINEERING.STACKEXCHANGE.COM

I know in C#, by default, referenced type variables are passed by reference to a method. I have a function which sometimes I just need its return value and sometimes both return value and the changes on the input object are needed outside of the function. Then I wrote it as the following: public static List<RuleSet> Load(XmlDocument dom= null) { if (dom == null) { dom = new XmlDocument(); }

Read more
Related news
Comment
FACEBOOK