예제 #1
0
        protected void Session_Start(object sender, EventArgs e)
        {
            var notifier = new NotificationComp();
            var now      = DateTime.Now;

            HttpContext.Current.Session["LastUpdated"] = now;
            notifier.Register(now);
        }
예제 #2
0
        public JsonResult GetNotifications()
        {
            var registerdTime = Session["LastUpdated"] != null?Convert.ToDateTime(Session["LastUpdated"]) : DateTime.Now;

            var notifier = new NotificationComp();
            var result   = notifier.GetLikes(registerdTime);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }