public JsonResult Events() { var json = new List <dynamic>(); using (var srv = new EventSrv()) { var past = srv.PastEvents().Take(5); var coming = srv.GetUpcoming(); var events = coming.Concat(past); foreach (var e in events) { json.Add(new { id = e.EventId, title = e.EventName, text = e.Description, date = e.FromDate }); } return(Json(json, JsonRequestBehavior.AllowGet)); } }
public PartialViewResult Upcoming() { var model = _srv.GetUpcoming(); return(PartialView(model)); }