From 53eff2a467a34dd428bcfde8e8fe4bc6509ea8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Sun, 29 Nov 2020 13:08:18 +0100 Subject: [PATCH] Using specific instance of one object when --- AutoFacSamles/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AutoFacSamles/Program.cs b/AutoFacSamles/Program.cs index 8794f76..60ed079 100644 --- a/AutoFacSamles/Program.cs +++ b/AutoFacSamles/Program.cs @@ -70,10 +70,13 @@ namespace AutoFacSamles static void Main(string[] args) { var builder = new ContainerBuilder(); - builder.RegisterType().As(); + //builder.RegisterType().As(); + var log = new ConsoleLog(); + builder.RegisterInstance(log).As(); //val av redan instantierat objekt + builder.RegisterType(); builder.RegisterType() - .UsingConstructor(typeof(Engine)); + .UsingConstructor(typeof(Engine)); //val av contructor IContainer container = builder.Build();