diff --git a/CommandCore.LightIoC/BasicServiceProvider.cs b/CommandCore.LightIoC/BasicServiceProvider.cs index 6ca4a95..f9f764a 100644 --- a/CommandCore.LightIoC/BasicServiceProvider.cs +++ b/CommandCore.LightIoC/BasicServiceProvider.cs @@ -19,19 +19,7 @@ private readonly ConcurrentDictionary /// If the concrete type is not instantiable. For instance, using an abstract class for the concrete type throws this exception. public void Register() { - if (typeof(T).IsAbstract) - { - throw new InvalidOperationException( - $"Type {typeof(T).FullName} may not be abstract. Abstract classes cannot be instantiated, hence not allowed to be registered."); - } - - if (!typeof(S).IsAssignableFrom(typeof(T))) - { - throw new InvalidOperationException( - $"Type {typeof(T).FullName} is not assignable to {typeof(S).FullName}"); - } - - _typeRegistry[typeof(S)] = typeof(T); + Register(typeof(S), typeof(T)); } public void Register(Type service, Type implementation)