Пример #1
0
        /// <summary>
        /// Converts the specified column name to a <see cref="SqlColumn"/> when concatenated
        /// with a <see cref="SqlTable"/>.
        /// </summary>
        /// <param name="table">
        /// The table used to access the column.
        /// </param>
        /// <param name="columnName">
        /// The name of the column.
        /// </param>
        /// <returns>
        /// A <see cref="SqlColumn"/> instance representing the specified column in the specified table.
        /// </returns>
        public static SqlColumn operator +(SqlTable table, string columnName)
        {
            SqlIdentifier identifier;

            if (table.Alias != null)
            {
                identifier = new SqlIdentifier(new[] { table.Alias, columnName });
            }
            else
            {
                var segments = table.TableName.Segments;
                identifier = new SqlIdentifier(segments.Concat(new[] { columnName }).ToArray());
            }
            return(new SqlColumn(identifier, null));
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlTable"/> class using the
 /// specified table name.
 /// </summary>
 /// <param name="tableName">
 /// The name of the table.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// Thrown when the <paramref name="tableName"/> argument is <see langword="null"/>,
 /// an empty string, or a string containing only white-space characters.
 /// </exception>
 public SqlTable(SqlIdentifier tableName)
     : this(tableName, null)
 {
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlColumn"/> class using the
 /// specified column name.
 /// </summary>
 /// <param name="columnName">
 /// The name of the column.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// Thrown when the <paramref name="columnName"/> argument is <see langword="null"/>,
 /// an empty string, or a string containing only white-space characters.
 /// </exception>
 public SqlColumn(SqlIdentifier columnName)
     : this(columnName, null)
 {
 }