Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created September 27, 2016 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/a9f6499ec127cf71f244050ce65f9b7d to your computer and use it in GitHub Desktop.
Save dcomartin/a9f6499ec127cf71f244050ce65f9b7d to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
namespace AspNetCore.Mvc.AttributeRouting.Demo.Controllers
{
public class ValuesController : Controller
{
[HttpGet("api/random/getmore")]
public IEnumerable<string> GetMoreStuff()
{
return new string[] { "value3", "value4" };
}
// GET api/values
[HttpGet("api/myvalues")]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("api/myvalues/{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