Class ApiVersioningExtensions
Defines a collection of extensions for API versioning.
Inheritance
System.Object
ApiVersioningExtensions
Namespace: MADE.Web.Extensions
Assembly: MADE.Web.dll
Syntax
public static class ApiVersioningExtensions : object
Methods
| Improve this Doc View SourceAddApiVersionHeaderSupport(IServiceCollection, String, Int32, Int32)
Adds request header API versioning for controllers and APIs to the specified services collection.
Declaration
public static IServiceCollection AddApiVersionHeaderSupport(this IServiceCollection services, string apiHeaderName = "x-api-version", int defaultMajor = 1, int defaultMinor = 0)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
System.String | apiHeaderName | The name of the header that is required when making requests to API endpoints. Default, x-api-version. |
System.Int32 | defaultMajor | The default major version of the API. Default, 1. |
System.Int32 | defaultMinor | The default minor version of the API. Default, 0. |
Returns
Type | Description |
---|---|
IServiceCollection | The configured |
AddApiVersionSupport(IServiceCollection, Int32, Int32)
Adds request API versioning for controllers and APIs to the specified services collection.
Declaration
public static IServiceCollection AddApiVersionSupport(this IServiceCollection services, int defaultMajor = 1, int defaultMinor = 0)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The |
System.Int32 | defaultMajor | The default major version of the API. Default, 1. |
System.Int32 | defaultMinor | The default minor version of the API. Default, 0. |
Returns
Type | Description |
---|---|
IServiceCollection | The configured |