Example #1
0
        public async Task <IActionResult> Post([FromBody] CreateCourseDto createCourseDto)
        {
            var lecturerId = createCourseDto.LecturerId;
            var lecturer   = await _lecturerRepo.FindAsync(lecturerId);

            var course = await _coursesService.CreateAsync(createCourseDto.Name, lecturer, createCourseDto.Capacity);


            return(Ok(course));
        }