Table of Contents

Class ServiceCollectionExtensions

Namespace
Cuemon.Extensions.Asp.Versioning
Assembly
Cuemon.Extensions.Asp.Versioning.dll

Extension methods for the Microsoft.Extensions.DependencyInjection.IServiceCollection interface.

public static class ServiceCollectionExtensions
Inheritance
Object
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

services IServiceCollection

The Microsoft.Extensions.DependencyInjection.IServiceCollection to extend.

setup Action<RestfulApiVersioningOptions>

The RestfulApiVersioningOptions that may be configured.

Returns

IServiceCollection

A reference to services so 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.