EFIngresProvider/SqlGen/Symbol.cs
/// <summary>
/// Write this symbol out as a string for sql.  This is just
/// the new name of the symbol (which could be the same as the old name).
///
/// We rename columns here if necessary.
/// </summary>
/// <param name="writer"></param>
/// <param name="sqlGenerator"></param>
Write this symbol out as a string for sql.  This is just
the new name of the symbol (which could be the same as the old name).

We rename columns here if necessary.
Write this symbol out as a string for sql . This is just the new name of the symbol ( which could be the same as the old name ) . We rename columns here if necessary .
public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
        {
            if (NeedsRenaming)
            {
                string newName;
                int i = sqlGenerator.AllColumnNames[NewName];
                do
                {
                    ++i;
                    newName = SqlGenerator.Format("{0}{1}", Name, i);
                } while (sqlGenerator.AllColumnNames.ContainsKey(newName));
                sqlGenerator.AllColumnNames[NewName] = i;
                NeedsRenaming = false;
                NewName = newName;
                sqlGenerator.AllColumnNames[newName] = 0;
            }
            writer.Write(SqlGenerator.QuoteIdentifier(NewName));
        }
public void WriteSql ( SqlWriter writer , SqlGenerator sqlGenerator ) { if ( NeedsRenaming ) { string newName ; int i = sqlGenerator . AllColumnNames [ NewName ] ; do { ++ i ; newName = SqlGenerator . Format ( " " , Name , i ) ; } while ( sqlGenerator . AllColumnNames . ContainsKey ( newName ) ) ; sqlGenerator . AllColumnNames [ NewName ] = i ; NeedsRenaming = false ; NewName = newName ; sqlGenerator . AllColumnNames [ newName ] = 0 ; } writer . Write ( SqlGenerator . QuoteIdentifier ( NewName ) ) ; }
Write this symbol out as a string for sql.
Write this symbol out as a string for sql .
// Prevent it from being renamed repeatedly. // Add this column name to list of known names so that there are no subsequent // collisions
writer
SqlWriter
None
sqlGenerator
SqlGenerator
None