Achieving versioning with Web API in ASP.NET MVC

There are two ways to achieve versioning with Web API

Method 1 : The simple method

/api/accountv1/
/api/accountv2/

The simplest way I found in versioning your API is to create an identical controller of “AccountV1Controller” and name it “AccountV2Controller“, notice the suffix V1 and V2 in controller name, we’ll depend on this part to select the appropriate controller based on API version.

Method 2 : Using routes

/api/v1/account
/api/v2/account

Or you could play with Routes to get the same behavior

config.Routes.MapHttpRoute(
    name: "1-0Api",
    routeTemplate: "api/v1/Account/{id}",
    defaults: new { controller = "AccountV1", id = RouteParameter.Optional }
);
config.Routes.MapHttpRoute(
    name: "2-0Api",
    routeTemplate: "api/v2/Account/{id}",
    defaults: new { controller = "AccountV2", id = RouteParameter.Optional }
);

Taken from here and here