Question
This question consists of two parts. The first part will consist of creating a Web API that will do CRUD (create, read, update, and delete)
This question consists of two parts. The first part will consist of creating a Web API that will do CRUD (create, read, update, and delete) operations on courses. The second part will consist of an Angular application that will interact with the API and call the different methods in the web API.
Web API
Create a web project called coursesAPI.
Add a class called Instructor containing the variables firstname and lastname.
Create another class called Course containing three variables ID, title, crn, and another variable of type Instructor called instructor.
Create a class called CourseInitializer that creates a list of 3 courses and puts that in the cache.
Create the folder: Controller and in it create a controller called CourseController.
Create the CRUD operations (create, read, update, and delete) using proper HTTP verbs
- -GetCourses: gets all courses
- -GetCourse: gets a course by ID
- -CreateCourse: creates a course
- -UpdateCourse: updates the course’s title
- -DeleteCourse: deletes a course by ID
Make sure you use the proper HTTP verb for these methods.
Step by Step Solution
3.47 Rating (163 Votes )
There are 3 Steps involved in it
Step: 1
To create the Web API you can follow these steps 1 Create a new ASPNET Web Application project in Visual Studio Choose the Web API template 2 Create the Instructor and Course classes in the Models fol...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started