Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Data.Entity / System / Data / SqlClient / SqlGen / SymbolPair.cs
1 //---------------------------------------------------------------------
2 // <copyright file="SymbolPair.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner  Microsoft
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
9
10 using System;
11 using System.Collections.Generic;
12 using System.Diagnostics;
13 using System.IO;
14 using System.Text;
15 using System.Data.SqlClient;
16 using System.Data.Metadata.Edm;
17 using System.Data.Common.CommandTrees;
18
19 namespace System.Data.SqlClient.SqlGen
20 {
21     /// <summary>
22     /// The SymbolPair exists to solve the record flattening problem.
23     /// <see cref="SqlGenerator.Visit(DbPropertyExpression)"/>
24     /// Consider a property expression D(v, "j3.j2.j1.a.x")
25     /// where v is a VarRef, j1, j2, j3 are joins, a is an extent and x is a columns.
26     /// This has to be translated eventually into {j'}.{x'}
27     /// 
28     /// The source field represents the outermost SqlStatement representing a join
29     /// expression (say j2) - this is always a Join symbol.
30     /// 
31     /// The column field keeps moving from one join symbol to the next, until it
32     /// stops at a non-join symbol.
33     /// 
34     /// This is returned by <see cref="SqlGenerator.Visit(DbPropertyExpression)"/>,
35     /// but never makes it into a SqlBuilder.
36     /// </summary>
37     class SymbolPair : ISqlFragment
38     {
39         public Symbol Source;
40         public Symbol Column;
41
42         public SymbolPair(Symbol source, Symbol column)
43         {
44             this.Source = source;
45             this.Column = column;
46         }
47
48         #region ISqlFragment Members
49
50         public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
51         {
52             // Symbol pair should never be part of a SqlBuilder.
53             Debug.Assert(false);
54         }
55
56         #endregion
57     }
58 }