namespace FSharpWeb.Controllers open System open System.Collections.Generic open System.Linq open System.Net.Http open System.Web.Http /// Retrieves values. [] type ValuesController() = inherit ApiController() let values = [|"value1";"value2"|] /// Gets all values. [] member x.Get() = values /// Gets the value with index id. [] member x.Get(id) : IHttpActionResult = if id > values.Length - 1 then x.BadRequest() :> _ else x.Ok(values.[id]) :> _