Esempio n. 1
0
        /// <summary>
        /// Initialize a new object.
        /// </summary>
        /// <param name="nativeDbType">Native database type as used in stored procedures.</param>
        /// <param name="typeMapper">Mapps native to target data types and renders code items associated with data type.</param>
        /// <param name="precision">Native DB type precision - if applicable.</param>
        /// <param name="scale">Native DB type scale - if applicable.</param>
        public TypeInfo(string nativeDbType, ITypeMapper typeMapper, int precision, int scale)
        {
            this.typeMapper = typeMapper;
            this.precision = precision;
            this.scale = scale;

            this.NativeDbType = typeMapper.NativeDbType(nativeDbType);
            this.IsVariableLengthNativeType = typeMapper.IsVariableLengthNativeType(nativeDbType);
            this.Type = typeMapper.Type(nativeDbType, precision, scale);
            this.DefaultValue = typeMapper.DefaultValue(nativeDbType, precision, scale);
            this.IsValueType = typeMapper.IsValueType(nativeDbType);
            this.DbType = typeMapper.DbType(nativeDbType);
            this.NullableType = typeMapper.NullableType(nativeDbType, precision, scale);
            this.NullValue = typeMapper.NullValue(nativeDbType, precision, scale);
            this.DataType = typeMapper.GetType(nativeDbType, precision, scale);
        }
 /// <summary>Generates <b>null</b> value.</summary>
 public string NullValue(ITypeMapper typeTemplate)
 {
     return typeTemplate.NullValue(this.NativeDbType, this.Precision, this.Scale);
 }