Ejemplo n.º 1
0
        /// <summary>
        /// Query whether the given C# type is supported and a schema node can potentially be created.
        /// </summary>
        public static bool IsSupported(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            while (true)
            {
                if (Primitives.ContainsKey(type))
                {
                    return(true);
                }

                if (type.IsArray)
                {
                    type = type.GetElementType();
                    continue;
                }

                return(false);
            }
        }