Skip to content

Instantly share code, notes, and snippets.

@finniv
Last active September 5, 2018 08:01
Show Gist options
  • Select an option

  • Save finniv/ea413b304049fe9f3ebfb3a0ceb70d12 to your computer and use it in GitHub Desktop.

Select an option

Save finniv/ea413b304049fe9f3ebfb3a0ceb70d12 to your computer and use it in GitHub Desktop.
namespace Cepheia.Api.Controllers
open Microsoft.AspNetCore.Mvc
open Microsoft.IdentityModel.Protocols.WsFederation
open System.Web.Http
open Microsoft.AspNetCore.Routing
[<Route("api/[controller]")>]
[<ApiController>]
type ValuesController () =
inherit ControllerBase()
[<HttpGet>]
member this.Get() =
let values = [|"value1"; "value2"|]
ActionResult<string[]>(values)
[<HttpGet("{id}")>]
member this.Get([<FromQuery>]id:int) =
let value = id.ToString();
ActionResult<string>(value)
[<HttpPost>]
member this.Post([<FromBody>] value:string) =
()
[<HttpPut("{id}")>]
member this.Put(id:int, [<FromBody>] value:string ) =
()
[<HttpDelete("{id}")>]
member this.Delete(id:int) =
()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment