public RegistrationEntry Register(Type interfaceType, Func <object> implementationFn) { if (interfaceType == null) { throw new ArgumentNullException(nameof(interfaceType)); } if (implementationFn == null) { throw new ArgumentNullException(nameof(implementationFn)); } var regEntry = new RegistrationEntry { InterfaceType = interfaceType, ImplementationInstanceFunc = implementationFn }; _registrationsCache[interfaceType] = regEntry; return(regEntry); }
public RegistrationEntry Register(Type interfaceType, Type implementationType = null) { if (interfaceType == null) { throw new ArgumentNullException(nameof(interfaceType)); } if (implementationType == null) { implementationType = interfaceType; } var regEntry = new RegistrationEntry { InterfaceType = interfaceType, ImplementationType = implementationType }; _registrationsCache[interfaceType] = regEntry; return(regEntry); }