From d7e6dcc3b24a8de8f45e33f8117f0553f2a316f6 Mon Sep 17 00:00:00 2001 From: Holger Boerchers Date: Wed, 15 Aug 2018 08:50:17 +0200 Subject: [PATCH] Added constraint for RegisterType --- Program.cs | 2 +- SmallInjector.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index b62240a..1483204 100644 --- a/Program.cs +++ b/Program.cs @@ -27,7 +27,7 @@ namespace SmallInjectorDemo useful2.TestTheServices(); Console.WriteLine(); useful3.TestTheServices(); - Console.ReadLine(); + //Console.ReadLine(); } } } \ No newline at end of file diff --git a/SmallInjector.cs b/SmallInjector.cs index 7b6ea80..aa95e4b 100644 --- a/SmallInjector.cs +++ b/SmallInjector.cs @@ -17,7 +17,7 @@ namespace SmallInjectorDemo /// Type of the interface of the service. /// True if the service should be singleton. False otherwise. /// instance of the service - public void RegisterType(bool isSingleton, TService instance = default(TService)) + public void RegisterType(bool isSingleton, TService instance = default(TService)) where TService : TInterface { _container.Add(typeof(TInterface), new RegisteredType(typeof(TService), isSingleton, null)); }