Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save superwalnut/a7cd78979f85126ddbde63a067df8be0 to your computer and use it in GitHub Desktop.
Save superwalnut/a7cd78979f85126ddbde63a067df8be0 to your computer and use it in GitHub Desktop.
code block for create-dotnet-core-console-app-with-autofac-dependency-injection-3
private ContainerBuilder ConfigureServices(IServiceCollection serviceCollection)
{
CreateLogger(Configuration);
serviceCollection.AddAutofac();
serviceCollection.AddOptions();
var builder = new ContainerBuilder();
builder.Populate(serviceCollection);
builder.RegisterLogger();
builder.RegisterModule<ConsoleModule>();
return builder;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment