builder.Register(c => new Foo()).As();
builder.RegisterType().As (); builder.RegisterType ().As ().WithParameter( new TypedParameter(typeof(IFoo), new Lazy (c => c.Resolve ())));
builder.Register(c => { var foo = c.ResolveHere, we're creating a factory method that creates instances of the Baz class. We're also resolving the IFoo dependency and passing it into the Baz constructor. The package library for Autofac is "Autofac". You can install it via NuGet or download it from the Autofac website at https://autofac.org/.(); return new Baz(foo); }).As ();