Created
October 1, 2019 05:26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IServiceProvider ConfigureServices(IServiceCollection services) | |
{ | |
// Add services to the collection | |
services.AddOptions(); | |
// create a container-builder and register dependencies | |
var builder = new ContainerBuilder(); | |
builder.RegisterModule(new AutofacModule()); | |
builder.Populate(services); | |
var container = builder.Build(); | |
// this will be used as the service-provider for the application! | |
return new AutofacServiceProvider(container); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment