示例#1
0
        protected virtual string BuildValue(QConst value)
        {
            object constValue = value.Value;

            // special processing for arrays
            if (constValue is IList)
            {
                return(BuildValue((IList)constValue));
            }
            if (constValue is string)
            {
                return(BuildValue((string)constValue));
            }

            return(Convert.ToString(constValue, System.Globalization.CultureInfo.InvariantCulture));
        }
示例#2
0
        protected virtual string BuildValue(QConst value)
        {
            object constValue = value.Value;

            if (constValue == null)
            {
                return("NULL");
            }

            if (constValue is string)
            {
                return(BuildValue((string)constValue));
            }

            return(Convert.ToString(constValue, System.Globalization.CultureInfo.InvariantCulture));
        }
示例#3
0
        protected override string BuildValue(QConst value)
        {
            object constValue = value.Value;

            // do not use parameter for nulls (type param cannot be determined by null)
            if (constValue == null && !(value is QVar))
            {
                return("NULL");
            }

            // all non-null constants are passed as parameters
            var cmdParam = DbFactory.AddCommandParameter(Command, constValue);

            if (value is QVar)
            {
                cmdParam.Parameter.SourceColumn = ((QVar)value).Name;
            }
            return(cmdParam.Placeholder);
        }
示例#4
0
        protected override string BuildValue(QConst value)
        {
            object constValue = value.Value;

            // keep special processing for lists
            if (constValue is IList)
            {
                return(BuildValue((IList)constValue));
            }

            // all constants are passed as parameters
            var cmdParam = DbFactory.AddCommandParameter(Command, constValue);

            if (value is QVar)
            {
                cmdParam.Parameter.SourceColumn = ((QVar)value).Name;
            }
            return(cmdParam.Placeholder);
        }