parent
c50e9e90f0
commit
8ebe0a2d29
|
|
@ -1,5 +1,6 @@
|
||||||
namespace Company.WebApplication1
|
namespace Company.WebApplication1
|
||||||
|
|
||||||
|
open System
|
||||||
open Microsoft.AspNetCore.Builder
|
open Microsoft.AspNetCore.Builder
|
||||||
open Microsoft.AspNetCore.Hosting
|
open Microsoft.AspNetCore.Hosting
|
||||||
open Microsoft.AspNetCore.Http
|
open Microsoft.AspNetCore.Http
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
namespace Company.WebApplication1
|
namespace Company.WebApplication1
|
||||||
|
|
||||||
|
open System
|
||||||
|
open System.Collections.Generic
|
||||||
|
open System.Linq
|
||||||
|
open System.Threading.Tasks
|
||||||
open Microsoft.AspNetCore.Builder
|
open Microsoft.AspNetCore.Builder
|
||||||
open Microsoft.AspNetCore.Hosting
|
open Microsoft.AspNetCore.Hosting
|
||||||
open Microsoft.AspNetCore.HttpsPolicy
|
open Microsoft.AspNetCore.HttpsPolicy
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ namespace Company.WebApplication1.Controllers
|
||||||
[Authorize]
|
[Authorize]
|
||||||
#endif
|
#endif
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
public class ValuesController : Controller
|
[ApiController]
|
||||||
|
public class ValuesController : ControllerBase
|
||||||
{
|
{
|
||||||
// GET api/values
|
// GET api/values
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
|
@ -31,7 +32,7 @@ namespace Company.WebApplication1.Controllers
|
||||||
|
|
||||||
// POST api/values
|
// POST api/values
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Post([FromBody]string value)
|
public void Post([FromBody] string value)
|
||||||
{
|
{
|
||||||
#if (OrganizationalAuth || WindowsAuth)
|
#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
|
// 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
|
// PUT api/values/5
|
||||||
[HttpPut("{id}")]
|
[HttpPut("{id}")]
|
||||||
public void Put(int id, [FromBody]string value)
|
public void Put(int id, [FromBody] string value)
|
||||||
{
|
{
|
||||||
#if (OrganizationalAuth || WindowsAuth)
|
#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
|
// 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
|
open Microsoft.AspNetCore.Mvc
|
||||||
|
|
||||||
[<Route("api/[controller]")>]
|
[<Route("api/[controller]")>]
|
||||||
|
[<ApiController>]
|
||||||
type ValuesController () =
|
type ValuesController () =
|
||||||
inherit Controller()
|
inherit ControllerBase()
|
||||||
|
|
||||||
[<HttpGet>]
|
[<HttpGet>]
|
||||||
member this.Get() =
|
member this.Get() =
|
||||||
|
|
@ -19,11 +20,11 @@ type ValuesController () =
|
||||||
"value"
|
"value"
|
||||||
|
|
||||||
[<HttpPost>]
|
[<HttpPost>]
|
||||||
member this.Post([<FromBody>]value:string) =
|
member this.Post([<FromBody>] value:string) =
|
||||||
()
|
()
|
||||||
|
|
||||||
[<HttpPut("{id}")>]
|
[<HttpPut("{id}")>]
|
||||||
member this.Put(id:int, [<FromBody>]value:string ) =
|
member this.Put(id:int, [<FromBody>] value:string ) =
|
||||||
()
|
()
|
||||||
|
|
||||||
[<HttpDelete("{id}")>]
|
[<HttpDelete("{id}")>]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
namespace Company.WebApplication1
|
namespace Company.WebApplication1
|
||||||
|
|
||||||
|
open System
|
||||||
|
open System.Collections.Generic
|
||||||
|
open System.Linq
|
||||||
|
open System.Threading.Tasks
|
||||||
open Microsoft.AspNetCore.Builder
|
open Microsoft.AspNetCore.Builder
|
||||||
open Microsoft.AspNetCore.Hosting
|
open Microsoft.AspNetCore.Hosting
|
||||||
open Microsoft.AspNetCore.HttpsPolicy
|
open Microsoft.AspNetCore.HttpsPolicy
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue