Confusing code with keyword ref
I am refactoring an old code base and I stumbled on this:
Problem number 1. The 2nd method it's called only by the 1st one. So I can remove it from interface, and make it private.
But my great doubt is with the ref AuditDto audit parameter.
Before being called there's always that code line: AuditDto audit = null;
Can I safely remove the ref AuditDto audit parameter and convert the method to Async?
Or because it's a parameter called by reference it will change audit status and I should not do that.
I understand that calling by reference will change the object status outside the method. My problem is that before being called it is always set to null.
So my final question is can I make something like:
Or, besides being called always as null, should I still worry with audit ?
Thank you !!!
Problem number 1. The 2nd method it's called only by the 1st one. So I can remove it from interface, and make it private.
But my great doubt is with the ref AuditDto audit parameter.
Before being called there's always that code line: AuditDto audit = null;
Can I safely remove the ref AuditDto audit parameter and convert the method to Async?
Or because it's a parameter called by reference it will change audit status and I should not do that.
I understand that calling by reference will change the object status outside the method. My problem is that before being called it is always set to null.
So my final question is can I make something like:
Or, besides being called always as null, should I still worry with audit ?
Thank you !!!