Files
adas-core/adas-core.Domain/Utils/ComparableDictionary.cs
T

20 lines
495 B
C#

using System.Text;
namespace adas_core.Domain.Utils;
public class ComparableDictionary<TKey, TValue> : Dictionary<TKey, TValue> where TKey : notnull where TValue : notnull
{
public override int GetHashCode()
{
StringBuilder str = new();
foreach (var item in this)
{
str.Append(item.Key);
str.Append('_');
str.Append(item.Value);
str.Append("%%");
}
return str.ToString().GetHashCode();
}
}