Created
August 28, 2019 08:14
-
-
Save GeradeDev/5d25bf52671202ad976449597056c49c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HomeController | |
{ | |
[ApiVersion("1.0", Deprecated = true)] | |
[Route("api/Values")] | |
public class HomeController : Controller | |
{ | |
[HttpGet] | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "Value1 from Version 1", "value2 from Version 1" }; | |
} | |
} | |
[ApiVersion("2.0")] | |
[Route("api/Values")] | |
public class HomeV2Controller : Controller | |
{ | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1 from Version 2", "value2 from Version 2" }; | |
} | |
[HttpGet, MapToApiVersion("3.0")] | |
public IEnumerable<string> GetV3() | |
{ | |
return new string[] { "value1 from Version 3", "value2 from Version 3" }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment