Skip to content

Commit 10edaf6

Browse files
committed
Move AppHost init to Program.cs
1 parent 9ca6fd5 commit 10edaf6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Configure.AppHost.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ public class AppHost : AppHostBase, IHostingStartup
1616
public void Configure(IWebHostBuilder builder) => builder
1717
.ConfigureServices(services => {
1818
// Configure ASP.NET Core IOC Dependencies
19-
})
20-
.Configure(app => {
21-
// Configure ASP.NET Core App
22-
if (!HasInit)
23-
app.UseServiceStack(new AppHost());
2419
});
2520

2621
public AppHost() : base("MyApp", typeof(MyServices).Assembly) {}

MyApp.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
8+
<ItemGroup>
9+
<Using Include="MyApp" />
10+
<Using Include="ServiceStack" />
11+
</ItemGroup>
812

913
<ItemGroup>
1014
<PackageReference Include="ServiceStack" Version="6.*" />

Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
app.UseHsts();
1111
app.UseHttpsRedirection();
1212
}
13+
app.UseServiceStack(new AppHost());
1314

1415
app.Run();

0 commit comments

Comments
 (0)