Esempio n. 1
0
		protected override IExpression VisitUnary(UnaryExpression unaryExpression)
		{
			if ((object)unaryExpression == null)
				throw new ArgumentNullException(nameof(unaryExpression));

			switch (unaryExpression.UnaryOperator)
			{
				case UnaryOperator.Not:
					this.Strings.Append(" NOT ");
					this.Visit(unaryExpression.TheExpression);
					break;
				case UnaryOperator.IsNull:
					this.Visit(unaryExpression.TheExpression);
					this.Strings.Append(" IS NULL ");
					break;
				case UnaryOperator.IsNotNull:
					this.Visit(unaryExpression.TheExpression);
					this.Strings.Append(" IS NOT NULL ");
					break;
				case UnaryOperator.Neg:
					this.Strings.Append(" - ");
					this.Visit(unaryExpression.TheExpression);
					break;
				case UnaryOperator.Pos:
					this.Strings.Append(" + ");
					this.Visit(unaryExpression.TheExpression);
					break;
				default:
					throw new NotSupportedException(string.Format("The unary operator '{0}' is not supported.", unaryExpression.UnaryOperator));
			}

			return unaryExpression;
		}
Esempio n. 2
0
		protected abstract IExpression VisitUnary(UnaryExpression unaryExpression);