Class ServiceCollectionExtensions
- Namespace
- Codebelt.Extensions.Asp.Versioning
- Assembly
- Codebelt.Extensions.Asp.Versioning.dll
Extension methods for the IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
Methods
AddRestfulApiVersioning(IServiceCollection, Action<RestfulApiVersioningOptions>)
Adds a compound service API versioning to the specified services collection that is optimized for RESTful APIs.
public static IServiceCollection AddRestfulApiVersioning(this IServiceCollection services, Action<RestfulApiVersioningOptions> setup = null)
Parameters
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<RestfulApiVersioningOptions>The RestfulApiVersioningOptions that may be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Remarks
This is a convenient method to add API versioning to your ASP.NET Core WebApi. Call AddApiVersioning, AddMvc and AddApiExplorer. Configuration, which is optimized for RESTful APIs, are done through setup.