-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the "Without ConfigureContainer" mechanism? #85
Comments
Ups, something got lost there. Which version of ASP.NET-Core are you on? Anyway, when below ASP.NET Core 3. You can do the following in your public IServiceProvider ConfigureServices(IServiceCollection services)
{
// add stuff to services, like services.AddMvc();
var containerBuilder = new ContainerBuilder();
// add stuff to the containerBuilder
containerBuilder.Populate(services);
var container = container.Build();
return new AutofacServiceProvider(container);
} I will create a PR soon to fix that.
What do you mean by that? Would you eloberate? |
…Service delegate fixes missing docs mentioned in autofac#85
Actually I don't think I had a further problem, or whatever it was, I've forgotten it! Thanks! |
Okay, then your question should be answered now. We have added a sample again on how to do it with ASPNET Core version < 3.0 and without configure container. |
The page https://github.com/autofac/Documentation/blob/master/docs/integration/aspnetcore.rst has a comment in a code example:
However it is not clear if this is actually shown?
Also, is it possible to combine
ConfigureContainer
andAddControllersAsServices()
... an example for that would be helpful as well.The text was updated successfully, but these errors were encountered: