parent
c50e9e90f0
commit
8ebe0a2d29
|
|
@ -1,5 +1,6 @@
|
|||
namespace Company.WebApplication1
|
||||
|
||||
open System
|
||||
open Microsoft.AspNetCore.Builder
|
||||
open Microsoft.AspNetCore.Hosting
|
||||
open Microsoft.AspNetCore.Http
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
namespace Company.WebApplication1
|
||||
|
||||
open System
|
||||
open System.Collections.Generic
|
||||
open System.Linq
|
||||
open System.Threading.Tasks
|
||||
open Microsoft.AspNetCore.Builder
|
||||
open Microsoft.AspNetCore.Hosting
|
||||
open Microsoft.AspNetCore.HttpsPolicy
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ namespace Company.WebApplication1.Controllers
|
|||
[Authorize]
|
||||
#endif
|
||||
[Route("api/[controller]")]
|
||||
public class ValuesController : Controller
|
||||
[ApiController]
|
||||
public class ValuesController : ControllerBase
|
||||
{
|
||||
// GET api/values
|
||||
[HttpGet]
|
||||
|
|
@ -31,7 +32,7 @@ namespace Company.WebApplication1.Controllers
|
|||
|
||||
// POST api/values
|
||||
[HttpPost]
|
||||
public void Post([FromBody]string value)
|
||||
public void Post([FromBody] string value)
|
||||
{
|
||||
#if (OrganizationalAuth || WindowsAuth)
|
||||
// For more information on protecting this API from Cross Site Request Forgery (CSRF) attacks, see https://go.microsoft.com/fwlink/?LinkID=717803
|
||||
|
|
@ -40,7 +41,7 @@ namespace Company.WebApplication1.Controllers
|
|||
|
||||
// PUT api/values/5
|
||||
[HttpPut("{id}")]
|
||||
public void Put(int id, [FromBody]string value)
|
||||
public void Put(int id, [FromBody] string value)
|
||||
{
|
||||
#if (OrganizationalAuth || WindowsAuth)
|
||||
// For more information on protecting this API from Cross Site Request Forgery (CSRF) attacks, see https://go.microsoft.com/fwlink/?LinkID=717803
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ open System.Threading.Tasks
|
|||
open Microsoft.AspNetCore.Mvc
|
||||
|
||||
[<Route("api/[controller]")>]
|
||||
[<ApiController>]
|
||||
type ValuesController () =
|
||||
inherit Controller()
|
||||
inherit ControllerBase()
|
||||
|
||||
[<HttpGet>]
|
||||
member this.Get() =
|
||||
|
|
@ -19,11 +20,11 @@ type ValuesController () =
|
|||
"value"
|
||||
|
||||
[<HttpPost>]
|
||||
member this.Post([<FromBody>]value:string) =
|
||||
member this.Post([<FromBody>] value:string) =
|
||||
()
|
||||
|
||||
[<HttpPut("{id}")>]
|
||||
member this.Put(id:int, [<FromBody>]value:string ) =
|
||||
member this.Put(id:int, [<FromBody>] value:string ) =
|
||||
()
|
||||
|
||||
[<HttpDelete("{id}")>]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
namespace Company.WebApplication1
|
||||
|
||||
open System
|
||||
open System.Collections.Generic
|
||||
open System.Linq
|
||||
open System.Threading.Tasks
|
||||
open Microsoft.AspNetCore.Builder
|
||||
open Microsoft.AspNetCore.Hosting
|
||||
open Microsoft.AspNetCore.HttpsPolicy
|
||||
|
|
|
|||
Loading…
Reference in New Issue