Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user