Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IServiceProvider ConfigureServices(IServiceCollection services)
- {
- services.AddMvc().AddControllersAsServices();
- var container = new Container().WithDependencyInjectionAdapter(services);
- return container.ConfigureServiceProvider<CompositionRoot>();
- }
- var builder = new HostBuilder()
- .ConfigureAppConfiguration((hostingContext, config) => { ... })
- .ConfigureServices((hostContext, services) =>
- {
- services.AddOptions();
- // configure services
- })
- .ConfigureLogging((hostingContext, logging) => { ... });
- var builder = new HostBuilder()
- .ConfigureAppConfiguration((hostingContext, config) => { ... })
- .ConfigureServices((hostContext, services) =>
- {
- services.AddOptions();
- // configure services
- })
- .ConfigureLogging((hostingContext, logging) => { ... })
- .UseStartup<Startup>(); //<-- That Startup class would have the `IServiceProvider ConfigureServices`
Add Comment
Please, Sign In to add comment