I'm encountering a lot of methods in my project that have a bunch of out parameters embedded in them and its making it cumbersome to call the methods as I have to start declaring the variables before calling the methods.
As such, I would like to refactor the code to return a struct instead and was wondering if this is a good idea.
One of the examples from an interface:
void CalculateFinancialReturnTotals(FinancialReturn fr, out decimal expenses, out decimal revenue, out decimal levyA, out decimal levyB, out decimal profit, out decimal turnover, out string message)
and if I was to refactor that, i would be putting all the out parameters in the struct such that the method signature is much simpler as below.
[structName] CalculateFinancialReturnTotals(FinancialReturn fr);