TeleSign / csharp_telesign_enterprise

The Telesign C# SDK lets you easily integrate with our REST API.
MIT License
2 stars 6 forks source link

Replace Dictionary.Add #1

Open ramsay opened 6 years ago

ramsay commented 6 years ago

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.