addon365 / b1ke-sh0wr00m

Apache License 2.0
0 stars 0 forks source link

Add Versioning for Rest API #5

Closed sathishid closed 6 years ago

sathishid commented 6 years ago

Old client must not be connected, if newer version release, this can be achieved by changing the rest api versions.

sathishid commented 6 years ago

This feature has been added.

Change the below version number in ConfigureService() of Startup.cs.

o.DefaultApiVersion = new ApiVersion(1,0);

Use this use {version:apiVersion} in Route attribute of each Controller:

[Produces("application/json")]
[Route("api/v{version:apiVersion}/Echo")]
public class EchoController : Controller

Commit Details: 4e657da00f92912d796e123923ed7e497449cb9a