diff --git a/src/TinyIoC/TinyIoC.cs b/src/TinyIoC/TinyIoC.cs index ba306ca..3025a68 100644 --- a/src/TinyIoC/TinyIoC.cs +++ b/src/TinyIoC/TinyIoC.cs @@ -3097,14 +3097,12 @@ where localType.IsAssignableFrom(implementationType) { RegisterMultiple(type, implementations); } - } - - var firstImplementation = implementations.FirstOrDefault(); - if (firstImplementation != null) + } + else if (implementations.Count() == 1) { try { - RegisterInternal(type, string.Empty, GetDefaultObjectFactory(type, firstImplementation)); + RegisterInternal(type, string.Empty, GetDefaultObjectFactory(type, implementations.First())); } catch (MethodAccessException) {