// GET: AssessmentResults/Create
        public async Task <IActionResult> Submit(string id)
        {
            try
            {
                var student = await studentRepository.FindByIdIncludeProgrammeAsync(id);

                if (student == null)
                {
                    ViewBag.StudentList = studentRepository.AllAsync();
                }
                else
                {
                    ViewBag.StudentId       = student.StudentID;
                    ViewBag.StudentFullName = student.FirstName + " " + student.SurName;
                }
                return(View());
            }
            catch (DataAccessException e)
            {
                ViewBag.ErrorMsg = ErrorProcessing.ProcessException("Data Access exception. ", e);
                return(RedirectToAction("Unknown", "Error"));
            }
            catch (Exception e)
            {
                ViewBag.ErrorMsg = ErrorProcessing.ProcessException("General exception. ", e);
                return(RedirectToAction("Unknown", "Error"));
            }
        }
        public async Task <IActionResult> GetStudentsAsync()
        {
            _logger.LogInformation("Get students");

            var students = await _studentRepository.AllAsync();

            return(Ok(_mapper.Map <IEnumerable <StudentDto> >(students)));
        }