Example #1
0
        /// <summary>
        /// 获取标签
        /// </summary>
        /// <param name="tagtype"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <returns></returns>
        public List <TagModel> GetList(List <string> ids = null, int skip = 0, int take = 1000)
        {
            var             tagdal = new TagDal();
            List <TagModel> list   = null;

            tagdal.PrepareIQueryable((query) =>
            {
                if (ValidateHelper.IsPlumpList(ids))
                {
                    query = query.Where(x => ids.Contains(x.UID));
                }
                list = query.OrderByDescending(x => x.CreateTime).Skip(skip).Take(take).ToList();
                return(true);
            });
            return(list);
        }
Example #2
0
        /// <summary>
        /// 获取标签
        /// </summary>
        /// <param name="tagtype"></param>
        /// <param name="skip"></param>
        /// <param name="take"></param>
        /// <returns></returns>
        public List <TagModel> GetList(List <int> ids = null, int skip = 0, int take = 1000)
        {
            ids = ConvertHelper.NotNullList(ids).Where(x => x > 0).ToList();
            var key = Com.GetCacheKey("TagBll.GetList:", string.Join(",", ids), skip.ToString(), take.ToString());

            return(Cache(key, () =>
            {
                var tagdal = new TagDal();
                List <TagModel> list = null;
                tagdal.PrepareIQueryable((query) =>
                {
                    if (ValidateHelper.IsPlumpList(ids))
                    {
                        query = query.Where(x => ids.Contains(x.TagID));
                    }
                    list = query.OrderByDescending(x => x.TagID).Skip(skip).Take(take).ToList();
                    return true;
                });
                return list;
            }));
        }