/// <summary> /// Detects if this Identity is equals to another Identity instance. /// </summary> /// <param name="other"> Identity object to compare. </param> /// <returns> True if they are equal, otherwise False. </returns> public bool Equals(Identity other) { if (other == null) { return(false); } if (UserAssignedIdentities.Count == other.UserAssignedIdentities.Count) { foreach (var identity in UserAssignedIdentities) { UserAssignedIdentity value; if (other.UserAssignedIdentities.TryGetValue(identity.Key, out value)) { if (!UserAssignedIdentity.Equals(identity.Value, value)) { return(false); } } else { return(false); } } } return(SystemAssignedIdentity.Equals(SystemAssignedIdentity, other.SystemAssignedIdentity)); }
public static bool Equals(SystemAssignedIdentity original, SystemAssignedIdentity other) { if (original == null) { return(other == null); } return(original.Equals(other)); }