public static void RegisterTypes(IUnityContainer container) { container.RegisterInstance(container); ITypeFinder typeFinder = new WebTypeFinder(); IEnumerable <Type> registerTypes = typeFinder.FindClassesOfType <IDependencyRegister>(); foreach (Type registerType in registerTypes) { IDependencyRegister register = (IDependencyRegister)Activator.CreateInstance(registerType); register.RegisterTypes(container); } }