From the course: Building Angular and ASP.NET Web API Apps
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Build the Create API endpoint
From the course: Building Angular and ASP.NET Web API Apps
Build the Create API endpoint
- [Instructor] In this part, we're going to create our first API endpoint. We're going to use this API endpoint to create or to add a new transaction in our database. For that, we need to create an API endpoint, which is going to expect from the Angular app and HttpPost request. For that, let us go to Visual Studio. To create all the new API endpoints, I'm going to create a new controller. So in this solution explorer, I'll just go to the controllers folder, right click in here, go to add, and then controller. By default, you're going to have the MVC controller, but you need to go here to the left and you need to create an API controller. Let us create that API controller empty because we want to add a code ourselves. So go to add then define a name. We are going to name this one. The transactions controller. When a controller is created, by default is just going to create a class and then it's going to inherit from the base class controller base. And then here at the top you're going…
Contents
-
-
-
-
Create an empty Web API Project9m 4s
-
(Locked)
Define application models5m 47s
-
(Locked)
Configure entity framework for database access13m 55s
-
(Locked)
Build the Create API endpoint10m 41s
-
(Locked)
Create the read-all API endpoint3m 4s
-
(Locked)
Create the read by ID API endpoint6m 55s
-
(Locked)
Create the update API endpoint7m 4s
-
(Locked)
Create the delete API endpoint3m 10s
-
(Locked)
Cleanup Code16m 24s
-
-
-
-
-