Inicio.AspNetCore.Versioning 5.0.0

dotnet add package Inicio.AspNetCore.Versioning --version 5.0.0
NuGet\Install-Package Inicio.AspNetCore.Versioning -Version 5.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Inicio.AspNetCore.Versioning" Version="5.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Inicio.AspNetCore.Versioning --version 5.0.0
#r "nuget: Inicio.AspNetCore.Versioning, 5.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Inicio.AspNetCore.Versioning as a Cake Addin
#addin nuget:?package=Inicio.AspNetCore.Versioning&version=5.0.0

// Install Inicio.AspNetCore.Versioning as a Cake Tool
#tool nuget:?package=Inicio.AspNetCore.Versioning&version=5.0.0

Example

In the following example, requests specifying API version 1 or 2 will return the original action method, Get. Requests for version 3 and above will return the modified implementation, Get_V3.

Note that there is no need to create an action method implementaion for every API version.

[HttpGet]
public ActionResult Get()
{
   return Ok();
}

[HttpGet, Version(3)]
public ActionResult Get_V3()
{
   return Ok();
}

Getting Started

  1. Reference Inicio.AspNetCore.Versioning.

  2. Add a Version parameter to all API routes.

    Note: the version parameter must be named {version}.

    [Route("api/v{version}/[controller]")]
    

    Optionally, a route constraint may be used:

    [Route("api/v{version:int}/[controller]")]
    
  3. Add Version attributes to actions requiring versioning.

    using Inicio.AspNetCore.Versioning;
    
    [HttpGet, Version(2)]
    public ActionResult Get_V2()
    {
       return Ok();
    }
    

    Optionally, both lower and upper version bounds can be specified:

    [Version(2, 3)]
    
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • net5.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Inicio.AspNetCore.Versioning:

Package Downloads
Inicio.AspNetCore.Versioning.Swagger

Adds Swagger support to Inicio.AspNetCore.Versioning.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.0 5,739 7/29/2021
3.1.0 1,405 4/8/2020
3.0.0 904 11/21/2019
1.1.0 832 8/12/2019
1.0.0 1,139 11/16/2018