Adf.Business.ValueObject.Email.CompareTo C# (CSharp) Method

CompareTo() public method

Compares the current Email to the supplied object.
public CompareTo ( object obj ) : int
obj object The object to compare to.
return int
        public int CompareTo(object obj)
        {
            Email other;
            try
            {
                other = (Email)obj;
            }
            catch (InvalidCastException)
            {
                throw new ArgumentException("obj is not an Email");
            }

            if (IsEmpty && other.IsEmpty) return 0;

            if (IsEmpty) return -1;

            return string.CompareOrdinal(value, other.value);
        }