private static string GetColor(string role) { if (role == null) { return(Color.Gray.ToHtml()); } if (RoleColors.TryGetValue(role, out Color color)) { return(color.ToHtml()); } return(ColorExtensions.ToHtmlColor(StringHashEncoder.GetHashCode32(role))); }
public override int GetHashCode() { return(id == null? base.GetHashCode() : StringHashEncoder.GetHashCode32(GetType().FullName) ^ id.Value.GetHashCode()); }