DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
QueryBuilder.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2015 Deveel
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 using System;
18 using System.Linq.Expressions;
19 
20 namespace Deveel.Data.Linq {
21  internal class QueryBuilder : ExpressionVisitor {
22  private readonly TableQuery resultQuery;
23 
24  public QueryBuilder() {
25  resultQuery = new TableQuery();
26  }
27 
28  public TableQuery Build(Expression expression) {
29  Visit(expression);
30  return resultQuery;
31  }
32 
33  public TableQuery Build() {
34  return Build(null);
35  }
36 
37  protected override Expression VisitBinary(BinaryExpression b) {
38  var expressionType = b.NodeType;
39  return base.VisitBinary(b);
40  }
41 
42  protected override MemberAssignment VisitMemberAssignment(MemberAssignment assignment) {
43  return base.VisitMemberAssignment(assignment);
44  }
45  }
46 }
TableQuery Build(Expression expression)
Definition: QueryBuilder.cs:28
override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
Definition: QueryBuilder.cs:42
readonly TableQuery resultQuery
Definition: QueryBuilder.cs:22
override Expression VisitBinary(BinaryExpression b)
Definition: QueryBuilder.cs:37