Ejemplo n.º 1
0
 public ActionResult AddCourse([FromBody] Course c)
 {
     if (CourseRepo.Add(c))
     {
         return(Ok("The Course has been successfully added"));
     }
     return(BadRequest("The Course has already been added"));
 }
Ejemplo n.º 2
0
 public IActionResult AddCourse([FromBody] CourseModel course)
 {
     if (CourseRepo.Add(course))
     {
         return(Ok("Course successfully added."));
     }
     else
     {
         return(BadRequest("This course already exists."));
     }
 }