public IActionResult AddCourseStudent([FromBody] List <CourseStudentDto> courseStudentDto)
        {
            if (!ModelState.IsValid)
            {
                // return 422
                return(new Helpers.UnprocessableEntityObjectResult(ModelState));
            }

            try
            {
                // save
                var courseStudentFromRepo = _courseRepository.AddCourseStudent(courseStudentDto);

                var courseStudentToReturn = _mapper.Map <IEnumerable <CourseStudentDto> >(courseStudentFromRepo);

                return(Ok(courseStudentToReturn));
            }
            catch (AppException ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }