fluffynuts / PeanutButter

Tasty, versatile, nutritious; goes with many things in .net.
BSD 3-Clause "New" or "Revised" License
179 stars 32 forks source link

SetValue return value #56

Closed AxelTechnology closed 2 years ago

AxelTechnology commented 2 years ago

Could you add a return value to SetValue() function? Example: bool true: succeeded false: failed Thank you.

fluffynuts commented 2 years ago

It always succeeds. If there is some reason not to, an exception would be thrown. Under the hood, it's essentially a Dictionary.Add, like https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.add?view=net-6.0

Having a return value is useless - it will always be true unless something fundamental breaks within .net dictionaries, in which case, an exception would be thrown, and I don't catch any exceptions at that level.