Created
April 25, 2016 18:51
-
-
Save seangwright/78abf83f17b3ee6883d3e08e100aef65 to your computer and use it in GitHub Desktop.
ValueController.cs
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Web.Http.Description; | |
namespace WiredViews.WIR03.Web.Api.Controllers | |
{ | |
/// <summary> | |
/// Value controller | |
/// </summary> | |
[RoutePrefix("values")] | |
public class ValueController : ApiController | |
{ | |
/// <summary> | |
/// Returns values | |
/// </summary> | |
/// <returns></returns> | |
[Route("")] | |
[ResponseType(typeof(IEnumerable<string>))] | |
public IHttpActionResult Get() | |
{ | |
return Ok(new string[] { "value1", "value2" }); | |
} | |
// GET: api/Value/5 | |
public string Get(int id) | |
{ | |
return "value"; | |
} | |
// POST: api/Value | |
public void Post([FromBody]string value) | |
{ | |
} | |
// PUT: api/Value/5 | |
public void Put(int id, [FromBody]string value) | |
{ | |
} | |
// DELETE: api/Value/5 | |
public void Delete(int id) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment