Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active September 27, 2016 16:10
Show Gist options
  • Save dcomartin/a79d40dc0eaaa0d79e10b87c867d9a18 to your computer and use it in GitHub Desktop.
Save dcomartin/a79d40dc0eaaa0d79e10b87c867d9a18 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
namespace AspNetCore.Mvc.AttributeRouting.Demo.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
// 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