Ejemplo n.º 1
0
        public virtual async Task <ActionResult> GetStudentsBySubjectId(Guid subjectId)
        {
            var currentSubject = await SubjectCore.GetAsync(subjectId, new[] {
                nameof(Subject.Students)
            }).ConfigureAwait(false);

            var studentsForCurrentSubject = currentSubject.Students.ToList();


            ViewBag.AllStudents = studentsForCurrentSubject;

            return(View("_studentList", studentsForCurrentSubject));
        }
Ejemplo n.º 2
0
        public virtual async Task <ActionResult> Delete(Guid Id, Subject model)
        {
            try
            {
                await SubjectCore.GetAsync(Id);

                await SubjectCore.DeleteAsync(model);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 3
0
        // GET: Subject/Delete/5
        public virtual async Task <ActionResult> Delete(Guid Id)
        {
            var std = await SubjectCore.GetAsync(Id);

            return(View(std));
        }