-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemWebHosting.cs
More file actions
28 lines (23 loc) · 937 Bytes
/
SystemWebHosting.cs
File metadata and controls
28 lines (23 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Microsoft.AspNet.Hosting
{
public static class SystemWebHosting
{
private static Action<IHostBuilder> configureHostAction;
private static Action<IWebHostBuilder> configureWebHostAction;
public static void ConfigureHost(Action<IHostBuilder> configureAction) => configureHostAction = configureAction;
public static void ConfigureWebHost(Action<IWebHostBuilder> configureAction) => configureWebHostAction = configureAction;
internal static IHostBuilder ConfigureHost(this IHostBuilder builder)
{
configureHostAction?.Invoke(builder);
return builder;
}
internal static IWebHostBuilder ConfigureWebHost(this IWebHostBuilder builder)
{
configureWebHostAction?.Invoke(builder);
return builder;
}
}
}