Created
May 15, 2018 20:47
-
-
Save SlyW/3a55dac086453fef76bb95b55abcf4fb to your computer and use it in GitHub Desktop.
Super Simple API Routing
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 System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
namespace SuperSimpleWebAPI.Controllers | |
{ | |
[RoutePrefix("Grammar")] | |
public class GrammarController : ApiController | |
{ | |
[Route("")] | |
[HttpGet] | |
public IHttpActionResult Get() { return Ok("Hello World"); } | |
[Route("{Dialog}")] | |
[HttpGet] | |
public IHttpActionResult Get(String Dialog) { return Ok("Hello World - " + Dialog); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment