Pomona.Common.TypeSystem.EnumerableTypeSpec.EnumerableTypeSpecFactory.CreateFromType C# (CSharp) Method

CreateFromType() public method

public CreateFromType ( ITypeResolver typeResolver, Type type ) : TypeSpec
typeResolver ITypeResolver
type System.Type
return TypeSpec
            public TypeSpec CreateFromType(ITypeResolver typeResolver, Type type)
            {
                if (typeResolver == null)
                    throw new ArgumentNullException(nameof(typeResolver));
                if (type == null)
                    throw new ArgumentNullException(nameof(type));

                Type itemTypeLocal;
                if (type == typeof(string) || !type.TryGetEnumerableElementType(out itemTypeLocal))
                    return null;

                return new EnumerableTypeSpec(typeResolver, type,
                                              CreateLazy(() => typeResolver.FromType(itemTypeLocal)));
            }
EnumerableTypeSpec.EnumerableTypeSpecFactory