Skip to content

Commit 0da4a7b

Browse files
committed
Remove unnecessary open statements
1 parent 8fbe18a commit 0da4a7b

File tree

1 file changed

+13
-18
lines changed
  • src/Content/NetCoreTool.Template.WebApi/FSharp

1 file changed

+13
-18
lines changed

src/Content/NetCoreTool.Template.WebApi/FSharp/Startup.fs

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
namespace Company.WebApplication1
22

3-
open System
4-
open System.Collections.Generic
5-
open System.Linq
6-
open System.Threading.Tasks
73
open Microsoft.AspNetCore.Builder
84
open Microsoft.AspNetCore.Hosting
9-
open Microsoft.AspNetCore.HttpsPolicy;
10-
open Microsoft.AspNetCore.Mvc
115
open Microsoft.Extensions.Configuration
126
open Microsoft.Extensions.DependencyInjection
137
open Microsoft.Extensions.Hosting
@@ -26,9 +20,6 @@ open Steeltoe.CloudFoundry.Connector.MySql.EFCore
2620
#if (ConnectorMySqlEfCoreOption && !Steeltoe2)
2721
open Steeltoe.Connector.MySql.EFCore
2822
#endif
29-
#if (AnyEfCore)
30-
open Company.WebApplication1.Models
31-
#endif
3223
#if (ConnectorMySqlOption && Steeltoe2)
3324
open Steeltoe.CloudFoundry.Connector.MySql
3425
#endif
@@ -90,7 +81,11 @@ open Steeltoe.Management.Tracing
9081
open Company.WebApplication1.Models
9182
#endif
9283

84+
#if (NeedsSelf)
9385
type Startup(configuration: IConfiguration) as self =
86+
#else
87+
type Startup(configuration: IConfiguration) =
88+
#endif
9489
member _.Configuration = configuration
9590

9691
// This method gets called by the runtime. Use this method to add services to the container.
@@ -111,13 +106,13 @@ type Startup(configuration: IConfiguration) as self =
111106
services.AddMySqlConnection(self.Configuration) |> ignore
112107
#endif
113108
#if (ConnectorMySqlEfCoreOption)
114-
services.AddDbContext<SampleContext>(fun options -> options.UseMySql(self.Configuration) |> ignore)
109+
services.AddDbContext<SampleContext>(fun options -> options.UseMySql(self.Configuration) |> ignore) |> ignore
115110
#endif
116111
#if (ConnectorPostgreSqlOption)
117112
services.AddPostgresConnection(self.Configuration) |> ignore
118113
#endif
119114
#if (ConnectorPostgreSqlEfCoreOption)
120-
services.AddDbContext<SampleContext>(fun options -> options.UseNpgsql(self.Configuration)) |> ignore
115+
services.AddDbContext<SampleContext>(fun options -> options.UseNpgsql(self.Configuration) |> ignore) |> ignore
121116
#endif
122117
#if (ConnectorRabbitMqOption)
123118
services.AddRabbitMQConnection(self.Configuration) |> ignore
@@ -129,26 +124,26 @@ type Startup(configuration: IConfiguration) as self =
129124
services.AddSqlServerConnection(self.Configuration) |> ignore
130125
#endif
131126
#if (CircuitBreakerHystrixOption)
132-
services.AddHystrixCommand<HelloHystrixCommand>("MyCircuitBreakers", self.Configuration) |> ignore
133-
services.AddHystrixMetricsStream(self.Configuration) |> ignore
127+
services.AddHystrixCommand<HelloHystrixCommand>("MyCircuitBreakers", self.Configuration)
128+
services.AddHystrixMetricsStream(self.Configuration)
134129
#endif
135130
#if (Steeltoe2ManagementEndpoints)
136-
services.AddCloudFoundryActuators(self.Configuration) |> ignore
131+
services.AddCloudFoundryActuators(self.Configuration)
137132
#endif
138133
#if (Steeltoe3ManagementEndpoints)
139-
services.AddAllActuators(self.Configuration) |> ignore
134+
services.AddAllActuators(self.Configuration)
140135
#endif
141136
#if (AnyTracing)
142137
#if (Steeltoe2)
143-
services.AddDistributedTracing(Configuration) |> ignore
138+
services.AddDistributedTracing(self.Configuration)
144139
#elif (Steeltoe30)
145140
services.AddDistributedTracing() |> ignore
146141
#else
147142
services.AddDistributedTracingAspNetCore() |> ignore
148143
#endif
149144
#endif
150145
// Add framework services.
151-
services.AddControllers() |> ignore
146+
services.AddControllers()
152147

153148
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
154149
member _.Configure(app: IApplicationBuilder, env: IWebHostEnvironment) =
@@ -166,7 +161,7 @@ type Startup(configuration: IConfiguration) as self =
166161
#endif
167162
#endif
168163
#if (Steeltoe2ManagementEndpoints)
169-
app.UseCloudFoundryActuators() |> ignore
164+
app.UseCloudFoundryActuators()
170165
#endif
171166
app.UseHttpsRedirection()
172167
.UseRouting()

0 commit comments

Comments
 (0)