コード例 #1
0
        public override void Visit(SqlSelectClause sqlSelectClause)
        {
            this.writer.Write("SELECT ");

            if (sqlSelectClause.HasDistinct)
            {
                this.writer.Write("DISTINCT ");
            }

            if (sqlSelectClause.TopSpec != null)
            {
                sqlSelectClause.TopSpec.Accept(this);
                this.writer.Write(" ");
            }

            sqlSelectClause.SelectSpec.Accept(this);
        }
コード例 #2
0
        public override int Visit(SqlSelectClause sqlSelectClause)
        {
            int hashCode = SqlSelectClauseHashCode;

            if (sqlSelectClause.HasDistinct)
            {
                hashCode = CombineHashes(hashCode, SqlSelectClauseDistinctHashCode);
            }

            if (sqlSelectClause.TopSpec != null)
            {
                hashCode = CombineHashes(hashCode, sqlSelectClause.TopSpec.Accept(this));
            }

            hashCode = CombineHashes(hashCode, sqlSelectClause.SelectSpec.Accept(this));
            return(hashCode);
        }
コード例 #3
0
        protected SqlQuery(
            SqlSelectClause selectClause,
            SqlFromClause fromClause,
            SqlWhereClause whereClause,
            SqlOrderbyClause orderbyClause,
            SqlOffsetLimitClause offsetLimitClause)
            : base(SqlObjectKind.Query)
        {
            if (selectClause == null)
            {
                throw new ArgumentNullException($"{nameof(selectClause)} must not be null.");
            }

            this.SelectClause      = selectClause;
            this.FromClause        = fromClause;
            this.WhereClause       = whereClause;
            this.OrderbyClause     = orderbyClause;
            this.OffsetLimitClause = offsetLimitClause;
        }