Closed jb69 closed 7 years ago
It never allowed it as terrible things could happen. Now I really don't allow it.
OK, nice response.
But you code now fails with its own default parameter value is the type of T is a string.
public T GetValueOrDefault<T>(string key, T defaultValue = default(T)) { if(defaultValue == null) { throw new ArgumentNullException(nameof(defaultValue), "Default value can not be null"); }
I will revert these changes for now. I will be making drastic changes to this API for 3.0 as the original API was to open and easily misinterpreted.
Feature Request:
Latest build no longer allows default values to be null even when that is a valid result for the type.
if (defaultValue == null) { throw new ArgumentNullException ("defaultValue", "Default value can not be null"); }
Please continue to allow default values of null.