Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Owin Selfhost
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