Esempio n. 1
0
        private static bool IsYukonOrNewer(EdmFunction edmFunction)
        {
            ReadOnlyMetadataCollection <FunctionParameter> parameters = edmFunction.Parameters;

            if (parameters == null || parameters.Count == 0)
            {
                return(false);
            }
            switch (edmFunction.Name.ToUpperInvariant())
            {
            case "COUNT":
            case "COUNT_BIG":
                return(((CollectionType)parameters[0].TypeUsage.EdmType).TypeUsage.EdmType.Name.Equals("Guid", StringComparison.OrdinalIgnoreCase));

            case "CHARINDEX":
                using (ReadOnlyMetadataCollection <FunctionParameter> .Enumerator enumerator = parameters.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        if (enumerator.Current.TypeUsage.EdmType.Name.Equals("Int64", StringComparison.OrdinalIgnoreCase))
                        {
                            return(true);
                        }
                    }
                    break;
                }
            }
            return(false);
        }