コード例 #1
0
        public JsonResult GetHomeworks()
        {
            ClassworkRepository repository = new ClassworkRepository();

            List <Classwork> groups = repository.GetAll();

            return(new JsonResult {
                Data = groups, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #2
0
        // 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));
        }