Convert ValuesController return types to ActionResult<T> (#351)
Addresses #339
This commit is contained in:
parent
12c3cf028c
commit
0879dbd082
|
|
@ -18,14 +18,14 @@ namespace Company.WebApplication1.Controllers
|
||||||
{
|
{
|
||||||
// GET api/values
|
// GET api/values
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IEnumerable<string> Get()
|
public ActionResult<IEnumerable<string>> Get()
|
||||||
{
|
{
|
||||||
return new string[] { "value1", "value2" };
|
return new string[] { "value1", "value2" };
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/values/5
|
// GET api/values/5
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
public string Get(int id)
|
public ActionResult<string> Get(int id)
|
||||||
{
|
{
|
||||||
return "value";
|
return "value";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,13 @@ type ValuesController () =
|
||||||
|
|
||||||
[<HttpGet>]
|
[<HttpGet>]
|
||||||
member this.Get() =
|
member this.Get() =
|
||||||
[|"value1"; "value2"|]
|
let values = [|"value1"; "value2"|]
|
||||||
|
ActionResult<string[]>(values)
|
||||||
|
|
||||||
[<HttpGet("{id}")>]
|
[<HttpGet("{id}")>]
|
||||||
member this.Get(id:int) =
|
member this.Get(id:int) =
|
||||||
"value"
|
let value = "value"
|
||||||
|
ActionResult<string>(value)
|
||||||
|
|
||||||
[<HttpPost>]
|
[<HttpPost>]
|
||||||
member this.Post([<FromBody>] value:string) =
|
member this.Post([<FromBody>] value:string) =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue