Ejemplo n.º 1
0
        /// <summary>
        /// 获取站内消息
        /// </summary>
        /// <returns></returns>
        public ActionResult GetMessages()
        {
            var post = PostService.LoadEntitiesFromL2CacheNoTracking(p => p.Status == Status.Pending).Select(p => new
            {
                p.Id,
                p.Title,
                p.PostDate,
                p.Author
            });
            var msgs = LeaveMessageService.LoadEntitiesFromL2CacheNoTracking(m => m.Status == Status.Pending).Select(p => new
            {
                p.Id,
                p.PostDate,
                p.NickName
            });
            var comments = CommentService.LoadEntitiesFromL2CacheNoTracking(c => c.Status == Status.Pending).Select(p => new
            {
                p.Id,
                p.CommentDate,
                p.PostId,
                p.NickName
            });

            return(ResultData(new
            {
                post,
                msgs,
                comments
            }));
        }