Created
August 27, 2019 15:29
-
-
Save GeradeDev/6534b4a101296edc10a37da79aeba230 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")] | |
[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 | |
{ | |
[HttpGet] | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1 from Version 2", "value2 from Version 2" }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment