Beispiel #1
0
        public Exams GetExamById(int entityToGetById)
        {
            IExamsRepository repo = new ExamsRepository(getEntities());

            Entities.Exams returnedValue  = repo.GetById(entityToGetById);
            Exams          returnedValue2 = Mapper.Map <Entities.Exams, Exams>(returnedValue);

            return(returnedValue2);
        }
        // GET: Exams/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Exam exam = examsRepo.GetById(id.Value);

            if (exam == null)
            {
                return(HttpNotFound());
            }

            var examVM = ExamMap.ExamToExamVM(exam);

            examVM.StudentProfile = examsRepo.GetStudentProfile(examVM.ExamId);

            return(View(examVM));
        }