public ActionResult Update_Attendees([DataSourceRequest] DataSourceRequest request, Attendee attendee)
 {
     if (ModelState.IsValid)
     {
         Update(attendee, ModelState);
     }
     
     return Json(new[] { attendee }.ToDataSourceResult(request, ModelState));
 }
        private static void Destroy(Attendee attendee, ModelStateDictionary modelState)
        {
            var attendees = GetAll();
            Attendee originalAttendee = attendees.Where(p => p.Value == attendee.Value).FirstOrDefault();

            if (originalAttendee != null)
            {
                attendees.Remove(originalAttendee);

                System.Web.HttpContext.Current.Session["Attendees"] = attendees;
            }
            else
            {
                modelState.AddModelError("value", "The desired record is no longer available.");
            }
        }
        private static void Insert(Attendee attendee)
        {
            var attendees = GetAll();

            attendee.Value = attendees.OrderByDescending(p => p.Value).First().Value + 1;

            attendees.Insert(0, attendee);

            System.Web.HttpContext.Current.Session["Attendees"] = attendees;
        }