From the course: Azure Microservices with .NET Core for Developers
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Obtaining a single product in the products microservice - Azure Tutorial
From the course: Azure Microservices with .NET Core for Developers
Obtaining a single product in the products microservice
- [Instructor] So far, we've built a fully functional controller that returns the whole products catalog from the in-memory database. In addition to this end point, we're going to implement another one that returns a single product. Let's see how we can do this. The first thing that I want to do is to implement this public async Task of type IActionResult. GetProductAsync method. Mapped to the Get verb here in the controller as well. But in this time we're going to ask for this ID parameter. So, in this attribute I'm going to use this template. So, the routing can know that it should map this ID to this parameter. Next, we have to change the IProductsProvider interface. Let's open Solution Explorer and let's go back to the IProductsProvider interface. And let's close this. We're going to implement something very similar. But in this time I'm going to return just a single product. The name of this item will be Product.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Designing a microservices solution1m 31s
-
Creating a .NET Core solution for microservices6m 45s
-
(Locked)
Creating the database context for the products microservice4m 59s
-
(Locked)
Creating the products provider8m 45s
-
(Locked)
Obtaining all the products in the products microservice8m 23s
-
(Locked)
Obtaining a single product in the products microservice4m 25s
-
(Locked)
Challenge: Implementing the customers and orders microservices1m 18s
-
(Locked)
Solution: Implementing the customers and orders microservices5m 59s
-
(Locked)
-
-
-
-
-