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.
Create the read by ID API endpoint
From the course: Building Angular and ASP.NET Web API Apps
Create the read by ID API endpoint
- [Instructor] Now in this part we're going to set up another API Endpoint and this API Endpoint is going to be used to get the details of a single transaction. We need this when we want to, for example, update a transaction because we click the Edit button, the transaction is loaded from the database, we fill in the form, then we update the data and we just send them back to the database. So in this part we're going to create an API Endpoint, which is going to be able to handle HttpGet requests from the Angular app, but as a parameter is going to also have the ID of the transaction. So I basically use the ID to gather data from the database. To create this API, let us go to Visual Studio. In Visual Studio in the same controller, I'm going to create another HttpGet action. So for that, just HttpGet. But this is going to also take as a parameter an id, so inside double quotes then curly brackets, I'm just going to define the id value. Then down here the same way we are going to have a…
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
-
-
-
-
-