public async Task <IActionResult> Index()
        {
            var addresses = _dbContext.Addresses
                            .Include(address => address.Students);

            var students = _dbContext.Students
                           .Include(student => student.Address)
                           .Include(student => student.Exams)
                           .ThenInclude(exam => exam.Exam);

            var exams       = _dbContext.Exams;
            var transcripts = _dbContext.Transcripts;

            var t = _service.GetTranscript(2, 1);
            var a = _service.GetTranscripts();

            var tDTO = new TranscriptDTO
            {
                ExamId    = 1,
                StudentId = 5,
                Points    = 30
            };

            t           = _service.SaveTranscript(tDTO);
            tDTO.Points = 60;

            t = _service.PutPoints(t.Id, tDTO);

            _service.DeleteTranscript(t.Id);

            return(View());
        }
예제 #2
0
        public IActionResult Delete(int id)
        {
            var deleted = _service.DeleteTranscript(id);

            if (deleted)
            {
                return(Ok("Transcript successfully deleted"));
            }

            return(BadRequest("There isn't any transcript with that id"));
        }