Adjust dictionary to use case-insensitive string comparer

Changed the `_aliasTypeDictionary` to use `StringComparer.OrdinalIgnoreCase`, ensuring that type aliases are not case-sensitive. This enhancement improves the robustness of type look-up operations.
This commit is contained in:
Sipke Schoorstra 2024-07-07 21:20:20 +02:00
parent 42067c035c
commit 90dc37ef98

View file

@ -7,7 +7,7 @@ namespace Elsa.Expressions.Services;
/// <inheritdoc />
public class WellKnownTypeRegistry : IWellKnownTypeRegistry
{
private readonly Dictionary<string, Type> _aliasTypeDictionary = new();
private readonly Dictionary<string, Type> _aliasTypeDictionary = new(StringComparer.OrdinalIgnoreCase);
private readonly Dictionary<Type, string> _typeAliasDictionary = new();
/// <summary>