public static bool TryGetPrimitiveTypeKind(this EdmType edmType, out PrimitiveTypeKind typeKind)
        {
            if (edmType.IsPrimitiveType())
            {
                typeKind = ((PrimitiveType)edmType).PrimitiveTypeKind;

                return(true);
            }

            typeKind = default(PrimitiveTypeKind);

            return(false);
        }
        internal static bool TryGetTypeFacetDescriptionByName(this EdmType edmType, string facetName, out FacetDescription facetDescription)
        {
            facetDescription = null;

            if (edmType.IsPrimitiveType())
            {
                var primitiveType = (PrimitiveType)edmType;

                foreach (var fd in primitiveType.FacetDescriptions)
                {
                    if (facetName.Equals(fd.FacetName, StringComparison.OrdinalIgnoreCase))
                    {
                        facetDescription = fd;

                        return(true);
                    }
                }
            }

            return(false);
        }