Class Extensions
Inherited Members
Namespace: FastEndpoints.AspVersioning
Assembly: FastEndpoints.AspVersioning.dll
Syntax
public static class Extensions
Methods
AddVersioning(IServiceCollection, Action<ApiVersioningOptions>?, Action<ApiExplorerOptions>?)
add Asp.Versioning.Http versioning support to the middleware pipeline
Declaration
public static IServiceCollection AddVersioning(this IServiceCollection services, Action<ApiVersioningOptions>? versioningOptions = null, Action<ApiExplorerOptions>? apiExplorerOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | |
Action<ApiVersioningOptions> | versioningOptions | action for configuring the verioning options |
Action<ApiExplorerOptions> | apiExplorerOptions | action for configuring the api explorer options |
Returns
Type | Description |
---|---|
IServiceCollection |
ApiVersion(AspNetCoreOpenApiDocumentGeneratorSettings, ApiVersion)
specify the version of this swagger document.
Declaration
public static void ApiVersion(this AspNetCoreOpenApiDocumentGeneratorSettings s, ApiVersion apiVersion)
Parameters
Type | Name | Description |
---|---|---|
AspNetCoreOpenApiDocumentGeneratorSettings | s | |
ApiVersion | apiVersion | only endpoints belonging to the specified version will show up for this swagger doc |
WithVersionSet(IEndpointConventionBuilder, string)
map the current endpoint to an api version set by specifying the api name
Declaration
public static IEndpointConventionBuilder WithVersionSet(this IEndpointConventionBuilder b, string apiName)
Parameters
Type | Name | Description |
---|---|---|
IEndpointConventionBuilder | b | |
string | apiName | the name of the api (swagger tag) this endpoint belongs to |
Returns
Type | Description |
---|---|
IEndpointConventionBuilder |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | thrown when the specified api set is not found in the VersionSets container |