Currently the function parameter parametersis sent by reference to every method call. Inside the methods we were using the Dictionary.Add method in the method body to add phone_number and other key/value pairs to the the parameters variable. The problem is that if the key already exists then Dictionary.Add will raise an exception. And since parameters is passed by reference the mutation carries over to additional method calls in the same stack which will almost certainly raise an exception unless the parameters instance is instantiated fresh every time.
Currently the function parameter
parameters
is sent by reference to every method call. Inside the methods we were using theDictionary.Add
method in the method body to addphone_number
and other key/value pairs to the theparameters
variable. The problem is that if the key already exists then Dictionary.Add will raise an exception. And sinceparameters
is passed by reference the mutation carries over to additional method calls in the same stack which will almost certainly raise an exception unless theparameters
instance is instantiated fresh every time.