From the course: Advanced Web APIs with ASP.NET Core 8
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Implementing URL versioning - ASP.NET Core Tutorial
From the course: Advanced Web APIs with ASP.NET Core 8
Implementing URL versioning
- [Instructor] Let's commence with, well, at least according to my preferences, the second best option, using the URL for version information. And with that I mean part of the path, not the query string. With the NuGet package we just installed, most of the actual work is already done. We just need to do some extra configuration. We start with our products controller, which is an API controller, and what we now do is we add another attribute, and that attribute is called API Version. That attribute receives the version number we intend to use as a parameter. So basically we are saying this products controller is, in our case, version 1.0 of our API. And we could implement another controller, and that other controller then would be another API version. And then we are setting up a route. The syntax looks a little bit special here, but essentially it says slash V, and then the API version number. So in our case, v1.0/products is the route for that controller. That's all we need to do…
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)
Introduction: API versioning29s
-
(Locked)
Versioning options2m 54s
-
(Locked)
NuGet versioning packages2m 54s
-
(Locked)
Implementing URL versioning9m 12s
-
(Locked)
Implementing header versioning3m 51s
-
(Locked)
Using the Accept header for versioning2m 40s
-
(Locked)
Implementing query string versioning2m 12s
-
(Locked)
Versioning minimal APIs7m 58s
-
(Locked)
Versioning and Swagger4m 14s
-
(Locked)
-
-