Skip to content

Commit f58f954

Browse files
authored
Remove unnecessary code from F# templates (#46443)
1 parent 287d7ea commit f58f954

File tree

7 files changed

+6
-42
lines changed

7 files changed

+6
-42
lines changed

src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-FSharp/Program.fs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
open System
22
open Microsoft.AspNetCore.Builder
3-
open Microsoft.Extensions.Hosting
43

54
[<EntryPoint>]
65
let main args =

src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Controllers/HomeController.fs

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
namespace Company.WebApplication1.Controllers
1+
namespace Company.WebApplication1.Controllers
22

3-
open System
4-
open System.Collections.Generic
5-
open System.Linq
6-
open System.Threading.Tasks
73
open System.Diagnostics
8-
94
open Microsoft.AspNetCore.Mvc
10-
open Microsoft.Extensions.Logging
11-
125
open Company.WebApplication1.Models
136

14-
type HomeController (logger : ILogger<HomeController>) =
7+
type HomeController () =
158
inherit Controller()
169

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

2316
[<ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)>]
2417
member this.Error () =
25-
let reqId =
18+
let reqId =
2619
if isNull Activity.Current then
2720
this.HttpContext.TraceIdentifier
2821
else

src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Program.fs

-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@ namespace Company.WebApplication1
22

33
#nowarn "20"
44

5-
open System
6-
open System.Collections.Generic
7-
open System.IO
8-
open System.Linq
9-
open System.Threading.Tasks
10-
open Microsoft.AspNetCore
115
open Microsoft.AspNetCore.Builder
12-
open Microsoft.AspNetCore.Hosting
136
#if !NoHttps
147
open Microsoft.AspNetCore.HttpsPolicy
158
#endif
16-
open Microsoft.Extensions.Configuration
179
open Microsoft.Extensions.DependencyInjection
1810
open Microsoft.Extensions.Hosting
19-
open Microsoft.Extensions.Logging
2011

2112
module Program =
2213
let exitCode = 0

src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Controllers/WeatherForecastController.fs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
namespace Company.WebApplication1.Controllers
1+
namespace Company.WebApplication1.Controllers
22

33
open System
4-
open System.Collections.Generic
5-
open System.Linq
6-
open System.Threading.Tasks
74
open Microsoft.AspNetCore.Mvc
8-
open Microsoft.Extensions.Logging
95
open Company.WebApplication1
106

117
[<ApiController>]

src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-FSharp/Program.fs

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
namespace Company.WebApplication1
22
#nowarn "20"
3-
open System
4-
open System.Collections.Generic
5-
open System.IO
6-
open System.Linq
7-
open System.Threading.Tasks
8-
open Microsoft.AspNetCore
3+
94
open Microsoft.AspNetCore.Builder
10-
open Microsoft.AspNetCore.Hosting
115
#if !NoHttps
126
open Microsoft.AspNetCore.HttpsPolicy
137
#endif
14-
open Microsoft.Extensions.Configuration
158
open Microsoft.Extensions.DependencyInjection
16-
open Microsoft.Extensions.Hosting
17-
open Microsoft.Extensions.Logging
189

1910
module Program =
2011
let exitCode = 0

src/ProjectTemplates/Web.ProjectTemplates/content/Worker-FSharp/Program.fs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
namespace Company.Application1
22

3-
open System
4-
open System.Collections.Generic
5-
open System.Linq
6-
open System.Threading.Tasks
73
open Microsoft.Extensions.DependencyInjection
84
open Microsoft.Extensions.Hosting
95

@@ -17,4 +13,4 @@ module Program =
1713
let main args =
1814
createHostBuilder(args).Build().Run()
1915

20-
0 // exit code
16+
0 // exit code

src/ProjectTemplates/Web.ProjectTemplates/content/Worker-FSharp/Worker.fs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
namespace Company.Application1
22

33
open System
4-
open System.Collections.Generic
5-
open System.Linq
64
open System.Threading
75
open System.Threading.Tasks
86
open Microsoft.Extensions.Hosting

0 commit comments

Comments
 (0)