File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 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
1818``` C#
1919public static IWebHost BuildWebHost (string [] args ) =>
2020 WebHost .CreateDefaultBuilder (args )
21- .UseUnityServiceProvider () < ----
21+ .UseUnityServiceProvider () < ---- Add this line
2222 .UseStartup <Startup >()
2323 .Build ();
2424```
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+
2536- Add optional method to your ` Startup ` class
2637``` C#
2738public void ConfigureContainer (IUnityContainer container )
You can’t perform that action at this time.
0 commit comments