public IActionResult EnrollmentCourse([FromBody] EnrollmentRequest enrollment) { var response = new EnrollmentResponse { Instructor = enrollment.Instructor, CourseId = enrollment.CourseId, EnrollmentId = idGenerator.GetEnrollmentId() }; return(Ok(response)); }
public IActionResult EnrollForCourse([FromBody] EnrollmentRequest enrollment) { var response = new EnrollmentResponse { CourseId = enrollment.CourseId, Instructor = enrollment.Instructor, EnrollmentId = Guid.NewGuid() }; return(Ok(response)); }
public IActionResult EnrollForCourse([FromBody] EnrollmentRequest enrollment) { // validate it... (do this later) // add it to the domain (database, etc.) // return some kind of meaningful response. var response = new EnrollmentResponse { CourseId = enrollment.CourseId, Instructor = enrollment.Instructor, EnrollmentId = idGenerator.GetEnrollmentId() }; return(Ok(response)); }
public IActionResult AddEnrollment([FromBody] EnrollmentRequest request) { var id = EnrollmentGenerator.GetNewId(); return(Ok($"[{id}]: You are enrooled for {request.ClassEnrolledFor} for {request.NumberOfDays} ({request.Student})")); }