diff --git a/AutoFacSamles/Program.cs b/AutoFacSamles/Program.cs index 41c7ba8..8794f76 100644 --- a/AutoFacSamles/Program.cs +++ b/AutoFacSamles/Program.cs @@ -46,7 +46,13 @@ namespace AutoFacSamles private Engine engine; private ILog log; - public Car(Engine engine,ILog log) + public Car(Engine engine) + { + this.engine = engine; + this.log = new EmailLog(); + } + + public Car(Engine engine, ILog log) { this.engine = engine; this.log = log; @@ -64,9 +70,10 @@ namespace AutoFacSamles static void Main(string[] args) { var builder = new ContainerBuilder(); - builder.RegisterType().As(); + builder.RegisterType().As(); builder.RegisterType(); - builder.RegisterType(); + builder.RegisterType() + .UsingConstructor(typeof(Engine)); IContainer container = builder.Build();