From the course: Building Web APIs with ASP.NET Core 8
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Creating a data model
From the course: Building Web APIs with ASP.NET Core 8
Creating a data model
- [Instructor] Before we actually start implementing the API, we have to set up our data model, the APIs for HPlusSport. So let's check the HPlusSport shop here. And in the shop, we have several categories, and those categories can have an arbitrary number of products. So let's just jump into one of those categories and let's pick a product. And we have a name and we have a price. We also have sizes and colors and options. We'll ignore them because we don't need them for our API, at least not within the scope of our course. So the actual data model is a bit more complex than what we are doing. But with those information so far, we can implement quite a bit with a ASP.NET Core web API. Note that the cross-back training tank here somehow doesn't show a price. Why? Because it's not available. So we should also have an option in our model that something is just currently out of stock. Let's head back over to our application. Here in Visual Studio, I first set up a new folder where I will…
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)
Controllers and actions7m 50s
-
(Locked)
Routing basics6m 14s
-
(Locked)
Creating a data model5m 54s
-
(Locked)
Using entity framework core7m 28s
-
(Locked)
Returning a list of items4m 4s
-
(Locked)
Using ActionResult2m 44s
-
(Locked)
Returning an item4m 29s
-
(Locked)
Handling errors3m 5s
-
(Locked)
Making the API asynchronous2m 51s
-
(Locked)
Working with minimal APIs5m 22s
-
(Locked)
Challenge: Searching items31s
-
(Locked)
Solution: Searching items3m 1s
-
(Locked)
-
-