Web API Versioning in Net Core Every Developer Should Know About | HOW TO - Code Samples

preview_player
Показать описание

#coding #codingbootcamp #softwaredeveloper #CodeYourFuture

In this video, we will explore three options for Web API versioning using .NET Core. We will set up and test each option to discover which is the most suitable for your project.

Requirements:
- Visual Studio (Community)
- .NET Core 6+
- ASP Web API project
- Asp.Versioning.Mvc.ApiExplorer (library)

NuGet package for versioning
The library Asp.Versioning.Mvc.ApiExplorer is provided by the .NET Foundation. This library offers the necessary functionality for the versioning process. You can obtain the library from NuGet packages in Visual Studio.

Versioning options

1. Header versioning:
For Header versioning, we utilize the HTTP request header values to pass the API version.

2. Query String versioning
With this versioning type, we overwrite the default query string (api-version) and set it as “version”.

3. URL Versioning
Using the UrlSegmentApiVersionReader signifies that we’ll send the version in a specific part of the URI segment.

Conclusion
We’ve covered three common methods for handling API versioning. I hope you find this video helpful. If you require further assistance or wish to provide feedback, your input is highly valued.

Lots of Great How Tos and Code Samples! Make sure to like and subscribe!
Рекомендации по теме