예제 #1
0
        /// <summary>
        /// Get th user events (he\she is registerd) list
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> GetCalendarData()
        {
            var eventDBList = (await _eventService.GetAllEventsForUserAsync(User.Identity)).ToList();
            var list        = JsonConvert.SerializeObject(eventDBList,
                                                          Formatting.None,
                                                          new JsonSerializerSettings
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            return(Content(list, "application/json"));

            //var list = JsonConvert.SerializeObject(eventDBList.ToList());
            //return Json(list, JsonRequestBehavior.AllowGet);
        }