DynamicQueryEngine/SpannerSpecificCreator.cs
/// <summary>
/// Determines the db type name for value.
/// </summary>
/// <param name="value">The value.</param>
/// <param name="realValueToUse">The real value to use. Normally it's the same as value, but in cases where value as a type isn't supported, the 
/// value is converted to a value which is supported.</param>
/// <returns>The name of the provider specific DbType enum name for the value specified</returns>
Determines the db type name for value.
Determines the db type name for value .
public override string DetermineDbTypeNameForValue(object value, out object realValueToUse)
        {
            realValueToUse = value;
            string dbTypeToUse;
            if((value == null) || (value == DBNull.Value))
            {
                dbTypeToUse = string.Empty;
            }
            else
            {
                switch(value.GetType().UnderlyingSystemType.FullName)
                {
                    case "System.String":
                        dbTypeToUse = "String";
                        break;
                    case "System.Int64":
					case "System.Int32":
					case "System.Int16":
					case "System.Byte":
					case "System.UInt64":
					case "System.UInt32":
					case "System.UInt16":
					case "System.SByte":
                        dbTypeToUse = "Int64";
                        break;
                    case "System.DateTime":
                        dbTypeToUse = "Timestamp";
                        break;
                    case "System.Boolean":
                        dbTypeToUse = "Bool";
                        break;
                    case "System.Byte[]":
                        dbTypeToUse = "Bytes";
                        break;
					case "System.Single":
					case "System.Double":
						dbTypeToUse = "Float64";
						break;
                    default:
                        dbTypeToUse = "String";
                        break;
                }
            }
            return dbTypeToUse;
        }
public override string DetermineDbTypeNameForValue ( object value , out object realValueToUse ) { realValueToUse = value ; string dbTypeToUse ; if ( ( value == null ) || ( value == DBNull . Value ) ) { dbTypeToUse = string . Empty ; } else { switch ( value . GetType ( ) . UnderlyingSystemType . FullName ) { case " " : dbTypeToUse = " " ; break ; case " " : case " " : case " " : case " " : case " " : case " " : case " " : case " " : dbTypeToUse = " " ; break ; case " " : dbTypeToUse = " " ; break ; case " " : dbTypeToUse = " " ; break ; case " " : dbTypeToUse = " " ; break ; case " " : case " " : dbTypeToUse = " " ; break ; default : dbTypeToUse = " " ; break ; } } return dbTypeToUse ; }
Determines the db type name for value.
Determines the db type name for value .
// don't set a type
The name of the provider specific DbType enum name for the value specified
The name of the provider specific DbType enum name for the value specified
value
object
None
object
out
realValueToUse
The real value to use. Normally it's the same as value, but in cases where value as a type isn't supported, the
value is converted to a value which is supported.
The real value to use . Normally it ' s the same as value but in cases where value as a type isn ' t supported the value is converted to a value which is supported .