Esempio n. 1
0
        public ActionResult Last()
        {
            var notice = NoticeService.GetFirstEntity(n => n.Status == Status.Display, n => n.ModifyDate, false);

            if (notice != null)
            {
                if (HttpContext.Session.Get("notice" + notice.Id) is null)
                {
                    notice.ViewCount++;
                    NoticeService.UpdateEntitySaved(notice);
                    HttpContext.Session.Set("notice" + notice.Id, notice.Id.GetBytes());
                }
                return(ResultData(notice.Mapper <NoticeOutputDto>()));
            }
            return(ResultData(null, false));
        }