Skip to content

Commit

Permalink
Remove unnecessary code from F# templates (#46443)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciekWin3 authored Feb 8, 2023
1 parent 287d7ea commit f58f954
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
open System
open Microsoft.AspNetCore.Builder
open Microsoft.Extensions.Hosting

[<EntryPoint>]
let main args =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
namespace Company.WebApplication1.Controllers
namespace Company.WebApplication1.Controllers

open System
open System.Collections.Generic
open System.Linq
open System.Threading.Tasks
open System.Diagnostics

open Microsoft.AspNetCore.Mvc
open Microsoft.Extensions.Logging

open Company.WebApplication1.Models

type HomeController (logger : ILogger<HomeController>) =
type HomeController () =
inherit Controller()

member this.Index () =
Expand All @@ -22,7 +15,7 @@ type HomeController (logger : ILogger<HomeController>) =

[<ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)>]
member this.Error () =
let reqId =
let reqId =
if isNull Activity.Current then
this.HttpContext.TraceIdentifier
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@ namespace Company.WebApplication1

#nowarn "20"

open System
open System.Collections.Generic
open System.IO
open System.Linq
open System.Threading.Tasks
open Microsoft.AspNetCore
open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
#if !NoHttps
open Microsoft.AspNetCore.HttpsPolicy
#endif
open Microsoft.Extensions.Configuration
open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.Logging

module Program =
let exitCode = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
namespace Company.WebApplication1.Controllers
namespace Company.WebApplication1.Controllers

open System
open System.Collections.Generic
open System.Linq
open System.Threading.Tasks
open Microsoft.AspNetCore.Mvc
open Microsoft.Extensions.Logging
open Company.WebApplication1

[<ApiController>]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
namespace Company.WebApplication1
#nowarn "20"
open System
open System.Collections.Generic
open System.IO
open System.Linq
open System.Threading.Tasks
open Microsoft.AspNetCore

open Microsoft.AspNetCore.Builder
open Microsoft.AspNetCore.Hosting
#if !NoHttps
open Microsoft.AspNetCore.HttpsPolicy
#endif
open Microsoft.Extensions.Configuration
open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Hosting
open Microsoft.Extensions.Logging

module Program =
let exitCode = 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
namespace Company.Application1

open System
open System.Collections.Generic
open System.Linq
open System.Threading.Tasks
open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Hosting

Expand All @@ -17,4 +13,4 @@ module Program =
let main args =
createHostBuilder(args).Build().Run()

0 // exit code
0 // exit code
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
namespace Company.Application1

open System
open System.Collections.Generic
open System.Linq
open System.Threading
open System.Threading.Tasks
open Microsoft.Extensions.Hosting
Expand Down

0 comments on commit f58f954

Please sign in to comment.