Esempio n. 1
0
        public static bool IsSignatureEqual(ProcState a, ProcState b, DbDriver dbDriver)
        {
            if (object.ReferenceEquals(a, b))
            {
                return(true);
            }
            if (a == null || b == null)
            {
                return(false);
            }

            var aFunc = a as FunctionState;
            var bFunc = b as FunctionState;

            if (aFunc != null && bFunc != null)
            {
                // If they're both functions, the return types need to match.
                if (!dbDriver.StringEquals(aFunc.ReturnType, bFunc.ReturnType))
                {
                    return(false);
                }
            }
            else if (aFunc != null || bFunc != null)
            {
                // If one of them is a function but NOT both, they aren't equal.
                return(false);
            }

            return(Enumerable.SequenceEqual(a.Parameters, b.Parameters, ProcParam.GetComparer(dbDriver)));
        }