-
Notifications
You must be signed in to change notification settings - Fork 698
Accessing Version Information
Chris Martinez edited this page Jul 28, 2016
·
3 revisions
All of the service API version information is accessible via extension methods. These features allow you to determine which API version was requested by a client as well as determine which versions are supported and deprecated. The API versions provided are automatically aggregated across all service implementations.
The most common usage is the current, client requested API version:
[ApiVersion( "1.0" )]
[ApiVersion( "2.0" )]
public class MyController : ApiController
{
protected ApiVersion RequestedApiVersion => Request.GetRequestedApiVersion();
}
[ApiVersion( "1.0" )]
[ApiVersion( "2.0" )]
public class Controller : Controller
{
protected ApiVersion RequestedApiVersion => HttpContext.GetRequestedApiVersion();
}
- Home
- Quick Starts
- Version Format
- Version Discovery
- Version Policies
- How to Version Your Service
- API Versioning with OData
- Configuring Your Application
- Error Responses
- API Documentation
- Extensions and Customizations
- Known Limitations
- FAQ
- Examples