using System.Collections.Generic;

namespace XmlForDB;

public class ErrorCodeInfoComparer : IEqualityComparer<ErrorCodeWithSubErrorCodeRIDInfo>
{
	public bool Equals(ErrorCodeWithSubErrorCodeRIDInfo x, ErrorCodeWithSubErrorCodeRIDInfo y)
	{
		return (string.Compare(x.MainErrorCode, y.MainErrorCode, ignoreCase: true) == 0 && string.Compare(x.SubErrorCodeCombinedOptionsRID, y.SubErrorCodeCombinedOptionsRID, ignoreCase: true) == 0) ? true : false;
	}

	public int GetHashCode(ErrorCodeWithSubErrorCodeRIDInfo obj)
	{
		return obj.MainErrorCode.ToLower().GetHashCode() + obj.SubErrorCodeCombinedOptionsRID.ToLower().GetHashCode();
	}
}
