Esempio n. 1
0
 /// <summary>
 /// 返回特定类型的对象的集合,其中类型由 T 参数定义
 /// </summary>
 public IDbQueryable<T> GetTable<T>()
 {
     DbQueryable<T> queryable = new DbQueryable<T> { Provider = this.Provider };
     queryable.DbExpressions = new List<DbExpression> { new DbExpression
     {
         DbExpressionType = DbExpressionType.GetTable,
         Expressions = new[] { Expression.Constant(typeof(T)) }
     } };
     return queryable;
 }
Esempio n. 2
0
        /// <summary>
        /// 创建查询
        /// </summary>
        public IDbQueryable <TResult> CreateQuery <TResult>(DbExpression exp = null)
        {
            IDbQueryable <TResult> query = new DbQueryable <TResult>
            {
                Provider      = _provider,
                DbExpressions = new List <DbExpression>(_dbExpressions)
            };

            if (exp != null)
            {
                query.DbExpressions.Add(exp);
            }
            return(query);
        }