public JsonResult GetHomeworks() { ClassworkRepository repository = new ClassworkRepository(); List <Classwork> groups = repository.GetAll(); return(new JsonResult { Data = groups, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
// GET: Events public ActionResult Index() { ClassworkRepository repository = new ClassworkRepository(); List <Classwork> classworks = repository.GetAll(); classworks.Reverse(); ClassworkListViewModel model = new ClassworkListViewModel(); model.Classworks = classworks; return(View(model)); }