Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created October 1, 2019 05:26
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