示例#1
0
        /// <summary>
        /// 返回分页数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="query"></param>
        /// <returns></returns>
        public static PageData <T> GetPageData <T>(this LambdaQuery.LambdaQuery <T> query) where T : IModel, new()
        {
            var obj = new PageData <T>()
            {
                CurrentPage = query.SkipPage, Rows = query.ToList <T>(), RowCount = query.RowCount
            };

            return(obj);
        }
示例#2
0
        /// <summary>
        /// 使用完整的LamadaQuery查询
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="query"></param>
        /// <returns></returns>
        public List <TModel> QueryList <TModel>(LambdaQuery.LambdaQuery <TModel> query) where TModel : CRL.IModel, new()
        {
            string key;
            var    list = QueryOrFromCache <TModel>(query, out key);

            list.ForEach(b =>
            {
                b.ManageName = dbContext.DBLocation.ManageName;
            });
            return(list);
        }
示例#3
0
 /// <summary>
 /// 关联查询分支
 /// </summary>
 /// <param name="query"></param>
 /// <param name="resultSelect"></param>
 internal LambdaQueryViewJoin(LambdaQuery <T> query, LambdaQueryResultSelect <TJoin, TJoinResult> resultSelect)
 {
     BaseQuery = query;
 }
示例#4
0
        /// <summary>
        /// 使用完整的LamadaQuery查询
        /// </summary>
        /// <typeparam name="TModel"></typeparam>
        /// <param name="query"></param>
        /// <returns></returns>
        public List <TModel> QueryList <TModel>(LambdaQuery.LambdaQuery <TModel> query) where TModel : CRL.IModel, new()
        {
            string key;

            return(QueryList <TModel>(query, out key));
        }
示例#5
0
 /// <summary>
 /// 返回首行首列
 /// </summary>
 /// <typeparam name="TModel"></typeparam>
 /// <param name="query"></param>
 /// <returns></returns>
 public abstract dynamic QueryScalar <TModel>(LambdaQuery.LambdaQuery <TModel> query) where TModel : CRL.IModel, new();
示例#6
0
 /// <summary>
 /// 返回字典
 /// </summary>
 /// <typeparam name="TModel"></typeparam>
 /// <typeparam name="TKey"></typeparam>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="query"></param>
 /// <returns></returns>
 public abstract Dictionary <TKey, TValue> ToDictionary <TModel, TKey, TValue>(LambdaQuery.LambdaQuery <TModel> query) where TModel : CRL.IModel, new();
示例#7
0
 /// <summary>
 /// 使用完整查询更新
 /// </summary>
 /// <typeparam name="TModel"></typeparam>
 /// <param name="query"></param>
 /// <param name="updateValue"></param>
 /// <returns></returns>
 public abstract int Update <TModel>(LambdaQuery.LambdaQuery <TModel> query, CRL.ParameCollection updateValue) where TModel : CRL.IModel, new();
 /// <summary>
 /// 关联查询分支
 /// </summary>
 /// <param name="query"></param>
 /// <param name="_resultSelect"></param>
 internal LambdaQueryViewJoin(LambdaQuery <T> query, ILambdaQueryResultSelect <TJoinResult> _resultSelect)
 {
     BaseQuery    = query;
     resultSelect = _resultSelect;
 }