Created
September 27, 2016 16:18
-
-
Save dcomartin/e4278a56ba2c20d17e2aed08453ff777 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
using System.Collections.Generic; | |
using Microsoft.AspNetCore.Mvc; | |
namespace AspNetCore.Mvc.AttributeRouting.Demo.Controllers | |
{ | |
[Route("api/[controller]")] | |
public class ValuesController : Controller | |
{ | |
[HttpGet("getmore")] | |
public IEnumerable<string> GetMoreStuff() | |
{ | |
return new string[] { "value3", "value4" }; | |
} | |
// GET api/values | |
[HttpGet] | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "value1", "value2" }; | |
} | |
// GET api/values/5 | |
[HttpGet("{id}")] | |
public string Get(int id) | |
{ | |
return "value"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment