EFIngresProvider/SqlGen/SqlGenerator/SqlGeneratorHelpers.cs
/// <summary>
/// Gets escaped TSql identifier describing this entity set.
/// </summary>
/// <returns></returns>
Gets escaped TSql identifier describing this entity set.
Gets escaped TSql identifier describing this entity set .
internal static string GetTargetTSql(EntitySetBase entitySetBase)
        {
            StringBuilder builder = new StringBuilder(50);
            string definingQuery = MetadataHelpers.TryGetValueForMetadataProperty<string>(entitySetBase, "DefiningQuery");
            if (!string.IsNullOrEmpty(definingQuery))
            {
                builder.Append("(");
                builder.Append(definingQuery);
                builder.Append(")");
            }
            else
            {
                string schemaName = MetadataHelpers.TryGetValueForMetadataProperty<string>(entitySetBase, "Schema");
                if (!string.IsNullOrEmpty(schemaName))
                {
                    builder.Append(SqlGenerator.QuoteIdentifier(schemaName));
                    builder.Append(".");
                }
                else
                {
                    builder.Append(SqlGenerator.QuoteIdentifier(entitySetBase.EntityContainer.Name));
                    builder.Append(".");
                }
                string tableName = MetadataHelpers.TryGetValueForMetadataProperty<string>(entitySetBase, "Table");
                if (!string.IsNullOrEmpty(tableName))
                {
                    builder.Append(SqlGenerator.QuoteIdentifier(tableName));
                }
                else
                {
                    builder.Append(SqlGenerator.QuoteIdentifier(entitySetBase.Name));
                }
            }
            return builder.ToString();
        }
internal static string GetTargetTSql ( EntitySetBase entitySetBase ) { StringBuilder builder = new StringBuilder ( 50 ) ; string definingQuery = MetadataHelpers . TryGetValueForMetadataProperty < string > ( entitySetBase , " " ) ; if ( ! string . IsNullOrEmpty ( definingQuery ) ) { builder . Append ( " " ) ; builder . Append ( definingQuery ) ; builder . Append ( " " ) ; } else { string schemaName = MetadataHelpers . TryGetValueForMetadataProperty < string > ( entitySetBase , " " ) ; if ( ! string . IsNullOrEmpty ( schemaName ) ) { builder . Append ( SqlGenerator . QuoteIdentifier ( schemaName ) ) ; builder . Append ( " " ) ; } else { builder . Append ( SqlGenerator . QuoteIdentifier ( entitySetBase . EntityContainer . Name ) ) ; builder . Append ( " " ) ; } string tableName = MetadataHelpers . TryGetValueForMetadataProperty < string > ( entitySetBase , " " ) ; if ( ! string . IsNullOrEmpty ( tableName ) ) { builder . Append ( SqlGenerator . QuoteIdentifier ( tableName ) ) ; } else { builder . Append ( SqlGenerator . QuoteIdentifier ( entitySetBase . Name ) ) ; } } return builder . ToString ( ) ; }
Gets escaped TSql identifier describing this entity set.
Gets escaped TSql identifier describing this entity set .
// construct escaped T-SQL referencing entity set
None
entitySetBase
EntitySetBase