コード例 #1
0
        public IActionResult EnrollmentCourse([FromBody] EnrollmentRequest enrollment)
        {
            var response = new EnrollmentResponse
            {
                Instructor   = enrollment.Instructor,
                CourseId     = enrollment.CourseId,
                EnrollmentId = idGenerator.GetEnrollmentId()
            };

            return(Ok(response));
        }
コード例 #2
0
        public IActionResult EnrollForCourse([FromBody] EnrollmentRequest enrollment)
        {
            var response = new EnrollmentResponse
            {
                CourseId     = enrollment.CourseId,
                Instructor   = enrollment.Instructor,
                EnrollmentId = Guid.NewGuid()
            };

            return(Ok(response));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        public IActionResult AddEnrollment([FromBody] EnrollmentRequest request)
        {
            var id = EnrollmentGenerator.GetNewId();

            return(Ok($"[{id}]: You are enrooled for {request.ClassEnrolledFor} for {request.NumberOfDays} ({request.Student})"));
        }