protected override IExpression VisitLiteralValue(LiteralValue literalValue)
		{
			ITacticParameter tacticParameter;
			string parameterName;
			Type valueType;

			if ((object)literalValue == null)
				throw new ArgumentNullException(nameof(literalValue));

			if ((object)literalValue.__ == null)
				throw new InvalidOperationException(string.Format("Cannot use the constant literal value NULL as a literalValue operand; use UnaryExpression(..., UnaryOperator.IsNull) instead."));

			parameterName = this.SqlNuance.GetParameterName(string.Format("expr_{0}", Guid.NewGuid().ToString("N")));
			valueType = literalValue.__.GetType();

			/*
				BACKLOG([email protected] / 2015 - 12 - 18):
				Find the column mapping attribute and lookup this junk...
			*/
			tacticParameter = new TacticParameter()
							{
								ParameterDirection = ParameterDirection.Input,
								ParameterDbType = DatazoidLegacyInstanceAccessor.AdoNetBufferingLegacyInstance.InferDbTypeForClrType(valueType),
								ParameterSize = default(int),
								ParameterPrecision = default(byte),
								ParameterScale = default(byte),
								ParameterNullable = true,
								ParameterName = parameterName,
								ParameterValue = literalValue.__
							};

			this.TacticParameters.Add(parameterName, tacticParameter);

			this.Strings.Append(parameterName);

			return literalValue;
		}
Exemple #2
0
		protected abstract IExpression VisitLiteralValue(LiteralValue literalValue);