Derive Web API templates from ControllerBase (#220)

Addresses #45
This commit is contained in:
Jass Bagga 2018-01-08 15:08:43 -08:00 committed by GitHub
parent c50e9e90f0
commit 8ebe0a2d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 6 deletions

View File

@ -1,5 +1,6 @@
namespace Company.WebApplication1
open System
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
open Microsoft.AspNetCore.Http

View File

@ -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

View File

@ -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]

View File

@ -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() =

View File

@ -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