diff --git a/LightweightIocContainer.Validation/IocValidator.cs b/LightweightIocContainer.Validation/IocValidator.cs index ec5d9cd..9cce812 100644 --- a/LightweightIocContainer.Validation/IocValidator.cs +++ b/LightweightIocContainer.Validation/IocValidator.cs @@ -48,7 +48,7 @@ public class IocValidator if (registration is IWithFactoryInternal { Factory: { } } withFactoryRegistration) { - (from createMethod in withFactoryRegistration.Factory.CreateMethods + (from createMethod in withFactoryRegistration.Factory.CreateMethods.Where(m => m.ReturnType == registration.InterfaceType) select createMethod.GetParameters().Select(p => p.ParameterType) into parameterTypes select (from parameterType in parameterTypes