I started using Autofac following these tutorials: http://flexamusements.blogspot.com/2010/09/dependency-injection-part-3-making-our.html
A simple class without a parameter in the constructor
builder.RegisterType<ConsoleOutputService>().As<IOutputService>();
As explained in the tutorial, the above code can be read like this: setup ConsoleOutputService as an implementation of IOutputService
Simple class with one parameter in the constructor
builder.Register(c => new MultipleOutputService(outputFilePath)).As<IOutputService>();
I donβt understand why we use a lambda expression to register this class (and what this expression does for sure) and why we cannot enter this code
builder.RegisterType<MultipleOutputService(outputFilePath)>().As<IOutputService>();
Thank you in advance for your help.
Swell source share