Esempio n. 1
0
        private void PutValue(DbType typecode, int length, TypeDefinitionInfo value)
        {
            SortedList <int, TypeDefinitionInfo> map;

            if (!typeMapping.TryGetValue(typecode, out map))
            {
                typeMapping[typecode] = map = new SortedList <int, TypeDefinitionInfo>();
            }

            map[length] = value;
        }
Esempio n. 2
0
        public string Get(DbType typecode, int?length, int?scale)
        {
            TypeDefinitionInfo result = null;

            if (length.HasValue)
            {
                result = GetValue(typecode, length.Value);
            }

            if (result == null)
            {
                result = new TypeDefinitionInfo {
                    TypeDefinitionPattern = GetDefaultValue(typecode), DefaultScale = null
                };
            }

            return(Replace(result.TypeDefinitionPattern, length, scale ?? result.DefaultScale));
        }
Esempio n. 3
0
        public string Get(DbType typecode, int? length, int? scale)
        {
            TypeDefinitionInfo result = null;

            if (length.HasValue)
            {
                result = GetValue(typecode, length.Value);
            }

            if (result == null)
            {
                result = new TypeDefinitionInfo { TypeDefinitionPattern = GetDefaultValue(typecode), DefaultScale = null };
            }

            return Replace(result.TypeDefinitionPattern, length, scale ?? result.DefaultScale);
        }
Esempio n. 4
0
        private void PutValue(DbType typecode, int length, TypeDefinitionInfo value)
        {
            SortedList<int, TypeDefinitionInfo> map;

            if (!typeMapping.TryGetValue(typecode, out map))
            {
                typeMapping[typecode] = map = new SortedList<int, TypeDefinitionInfo>();
            }

            map[length] = value;
        }