Created
July 15, 2015 01:53
-
-
Save dcomartin/b8aebc5c866b0b8c2a98 to your computer and use it in GitHub Desktop.
Owin Selfhost
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.Web.Http; | |
namespace AspNetSelfHostDemo | |
{ | |
public class DemoController : ApiController | |
{ | |
// GET api/demo | |
public IEnumerable<string> Get() | |
{ | |
return new string[] { "Hello", "World" }; | |
} | |
// GET api/demo/5 | |
public string Get(int id) | |
{ | |
return "Hello, World!"; | |
} | |
// POST api/demo | |
public void Post([FromBody]string value) | |
{ | |
} | |
// PUT api/demo/5 | |
public void Put(int id, [FromBody]string value) | |
{ | |
} | |
// DELETE api/demo/5 | |
public void Delete(int id) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment