/// <summary> /// Binds the specified <see cref="QueryNode"/>. /// </summary> /// <param name="node">The <see cref="QueryNode"/> to bind.</param> /// <exception cref="System.NotSupportedException">Thrown if the node is not supported.</exception> protected void Bind(QueryNode node) { var singleValueNode = node as SingleValueNode; if (singleValueNode == null) { throw new NotSupportedException(); } switch (node.Kind) { case QueryNodeKind.BinaryOperator: this.BindBinaryOperatorNode((BinaryOperatorNode)node); break; case QueryNodeKind.Constant: this.BindConstantNode((ConstantNode)node); break; case QueryNodeKind.SingleValueFunctionCall: this.BindSingleValueFunctionCallNode((SingleValueFunctionCallNode)node); break; case QueryNodeKind.SingleValuePropertyAccess: this.BindSingleValuePropertyAccessNode((SingleValuePropertyAccessNode)node); break; case QueryNodeKind.UnaryOperator: this.BindUnaryOperatorNode((UnaryOperatorNode)node); break; default: throw new NotSupportedException("Nodes of type '" + node.Kind.ToString() + "' are not supported"); } }
internal void AddParameter(QueryNode queryNode) => ((IList <QueryNode>) this.Parameters).Add(queryNode);