コード例 #1
0
        protected override void AddColumnSelection <TEntity>(
            string alias,
            string tableName,
            string tableSchema,
            string name,
            Aggregation aggregation = Aggregation.None)
        {
            if (string.IsNullOrWhiteSpace(tableName))
            {
                tableName = TableNameFromType <TEntity>();
            }
            if (string.IsNullOrWhiteSpace(tableSchema))
            {
                tableSchema = "dbo";
            }
            var selections      = this.selections;
            var columnSelection = new ColumnSelection();

            columnSelection.Alias       = alias;
            columnSelection.Table       = tableName;
            columnSelection.Schema      = tableSchema;
            columnSelection.Name        = name;
            columnSelection.Aggregation = aggregation;
            selections.Add(columnSelection);
        }
コード例 #2
0
        public override ISelectClauseBuilder CountAll()
        {
            var selections      = this.selections;
            var columnSelection = new ColumnSelection();

            columnSelection.Name        = "*";
            columnSelection.Aggregation = Aggregation.Count;
            selections.Add(columnSelection);
            return(this);
        }