예제 #1
0
        public virtual Interface.IQueryable <T> MergeTable()
        {
            //  Check.Exception(this.QueryBuilder.SelectValue.IsNullOrEmpty(), "MergeTable need to use Select(it=>new{}) Method .");
            // Check.Exception(this.QueryBuilder.Skip > 0 || this.QueryBuilder.Take > 0, "MergeTable  Queryable cannot Take Skip OrderBy PageToList  ");
            var sql       = QueryBuilder.ToSqlString();
            var tableName = this.SqlBuilder.GetPackTable(sql, "MergeTable");

            return(this.Context.Queryable <ExpandoObject>().AS(tableName).Select <T>("*"));
        }
예제 #2
0
        public virtual int Count()
        {
            QueryBuilder.IsCount = true;
            var sql = string.Empty;

            sql = QueryBuilder.ToSqlString();
            sql = QueryBuilder.ToCountSql(sql);
            var reval = Context.Ado.GetInt(sql, QueryBuilder.Parameters.ToArray());

            QueryBuilder.IsCount = false;
            return(reval);
        }
예제 #3
0
        public virtual KeyValuePair <string, List <Parameter> > ToSql()
        {
            string sql = QueryBuilder.ToSqlString();

            return(new KeyValuePair <string, List <Parameter> >(sql, QueryBuilder.Parameters));
        }