File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,21 @@ Install-Package Unity.Microsoft.DependencyInjection
18
18
``` C#
19
19
public static IWebHost BuildWebHost (string [] args ) =>
20
20
WebHost .CreateDefaultBuilder (args )
21
- .UseUnityServiceProvider () < ----
21
+ .UseUnityServiceProvider () < ---- Add this line
22
22
.UseStartup <Startup >()
23
23
.Build ();
24
24
```
25
+
26
+ - In case Unity container configured via application configuration or by convention this container could be used to initalize service provider.
27
+
28
+ ``` C#
29
+ public static IWebHost BuildWebHost (string [] args ) =>
30
+ WebHost .CreateDefaultBuilder (args )
31
+ .UseUnityServiceProvider (_container ) < ---- or add this line
32
+ .UseStartup <Startup >()
33
+ .Build ();
34
+ ```
35
+
25
36
- Add optional method to your ` Startup ` class
26
37
``` C#
27
38
public void ConfigureContainer (IUnityContainer container )
You can’t perform that action at this time.
0 commit comments