Closed alexwiese closed 3 months ago
This is expected behavior. It is handler in a different class (see GenericDictionaryAccessor). This happens because value resolution is forwarded to dictionary directly and your dictionary handles keys in case-sensitive way.
It’s expected that value resolution fails even if the correct key is provided (with matching casing)?
Describe the bug
Example:
Handlebars.Net 2.1.4
Given a![image](https://github.com/Handlebars-Net/Handlebars.Net/assets/2103355/fb5a8e59-ea2f-4d8f-ad5c-185899d4f63f)
Dictionary<object, object>
only keys that are lower case are resolved:Expected behavior:
The values can be resolved using keys that contain upper case letters.
Test to reproduce
Other related info
Looks like it's related to this code which always uses
memberName.LowerInvariant
. Is there a reason it's always converted to lower case before accessing the value? Is a special case needed forDictionary<object, TValue>
to handle this?