public JoinBlock(QueryBlock query, JoinType joinType, TableRef innerRef, StatementBlock on) { this.query = query; JoinType = joinType; InnerRef = innerRef; On = on; }
public void ApplyJoin(JoinType joinType, TableRef inner, LambdaExpression outerKeySelector, LambdaExpression innerKeySelector, LambdaExpression membersSelector) { var left = new StatementBlock(query.QueryBatch, outerKeySelector.Body, new QueryMapWithLambdaParam(query.QueryMap, outerKeySelector.Parameters[0])); var right = new StatementBlock(query.QueryBatch, innerKeySelector.Body, new QueryMapWithLambdaParam(inner.QueryMap, innerKeySelector.Parameters[0])); Joins.Add(new JoinBlock(query, joinType, inner, new StatementBlock($"{left} = {right}"))); var p1 = new QueryMapWithLambdaParam(query.QueryMap, membersSelector.Parameters[0]); var p2 = new QueryMapWithLambdaParam(inner.QueryMap, membersSelector.Parameters[1]); query.QueryMap = new MapTransformer(p1, p2).Transform(membersSelector.Body); }
public ColumnMap(TypeMemberPath memberPath, StatementBlock statement) { MemberPath = memberPath; Statement = statement; }