using System.Collections.Generic; namespace IwbZero.Authorization.Base.Permissions { internal class DataPermissionNameComparer : IEqualityComparer { public static DataPermissionNameComparer Instance => new DataPermissionNameComparer(); public bool Equals(string x, string y) { if (string.IsNullOrEmpty(x) && string.IsNullOrEmpty(y)) { return true; } if (string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y)) { return false; } if (x.EndsWith($"@{(int)OperType.All}")) { return true; } return x == y; } public int GetHashCode(string obj) { return obj.GetHashCode(); } } }