Ejemplo n.º 1
0
        public static SqlType Resolve(SqlTypeCode typeCode, string typeName, DataTypeMeta[] metadata, ITypeResolver resolver)
        {
            if (PrimitiveTypes.IsPrimitive(typeCode))
                return PrimitiveTypes.Resolve(typeCode, typeName, metadata);

            if (resolver == null)
                throw new NotSupportedException(String.Format("Cannot resolve type '{0}' without context.", typeName));

            var resolveCcontext = new TypeResolveContext(typeCode, typeName, metadata);
            return resolver.ResolveType(resolveCcontext);
        }
Ejemplo n.º 2
0
        public TypeResolveContext(SqlTypeCode typeCode, string typeName, DataTypeMeta[] meta)
        {
            TypeCode = typeCode;
            TypeName = typeName;

            this.meta = new Dictionary<string, DataTypeMeta>(StringComparer.OrdinalIgnoreCase);

            if (meta != null) {
                foreach (var typeMeta in meta) {
                    this.meta[typeMeta.Name] = typeMeta;
                }
            }
        }