The 2nd code block in the documentation page here has an outdated method for configuring a container after it has been created.
The specific text is:
// Example #2 - Create an container instance but add configuration later.
var container2 = new Container();
container2.Configure(c =>
{
c.For<IFoo>().Use<Foo>();
c.For<IBar>().Use<Bar>();
});
This throws the following error:
'IServiceCollection' does not contain a definition for 'For' and no accessible extension method 'For' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)
From @CodingGorilla
the Container.Configure() uses strictly the IServiceCollection which is the abstraction from MS' di system. so it won't have any of the service registry specific DSL functions.
The 2nd code block in the documentation page here has an outdated method for configuring a container after it has been created. The specific text is:
This throws the following error:
From @CodingGorilla