111
CHAPTER 5 | Designing and Developing Multi-Container and Microservice-Based .NET Applications
With URI versioning, as in the eShopOnContainers sample application, each time you modify the Web
API or change the schema of resources, you add a version number to the URI for each resource.
Existing URIs should continue to operate as before, returning resources that conform to the schema
that matches the requested version.
As shown in the following code example, the version can be set by using the Route attribute in the
Web API controller, which makes the version explicit in the URI (v1 in this case).
[
Route
(
"api/v1/[controller]"
)]
Dostları ilə paylaş: