- Notifications
You must be signed in to change notification settings - Fork710
-
For the moment, we're using the following syntax to define which versions can be used by a controller. [ApiController][ApiVersion(ApiVersions.V1_0)][ApiVersion(ApiVersions.V2_0)]publicclassMyController:ControllerBase{} But when anew version is added, how is it possible to make it accessible to all controllers without having to add a new Is it possible to indicate the version from which a controller is available?
|
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
-
Out-of-the-box, the short answer is - no; however, there are many extensions to enable it. This type of solution is very specific to your application and cannot be easily genericized. API versionsmust be explicit, which is intrinsically why it isn't supported by default. Thestep is one of the biggest challenges. What should the step between versions be? A major version? A minor version? How about if the version is a date? There are several possible solutions, but there is no universal answer that suites everyone (or it would be baked in). There are a number of options presented in discussions and (closed) issues. At a high level, you have several options:
If all of your controllers are symmetrical and use the same set of versions, a custom convention (a la
|
BetaWas this translation helpful?Give feedback.