예제 #1
0
        public IActionResult Post([FromBody] CreateCourseDto model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid input"));
            }
            var result = repository.CreateCourse(model);

            if (result)
            {
                return(Ok("Course created successfully"));
            }
            return(StatusCode(StatusCodes.Status500InternalServerError));
        }