public static void AutoRegisterSelfImplementingTypes([NotNull] this Container container,
                                                             [NotNull] Assembly assembly,
                                                             [NotNull] Lifestyle defaultLifestyle,
                                                             Func <Type, Lifestyle> customLifestyleSelector = null,
                                                             Func <Type, bool> instancePredicate            = null,
                                                             Func <Type, bool> interfacePredicate           = null,
                                                             bool onlyPublicInterfaces = true)
        {
            container.RequiredNotNull("container");
            assembly.RequiredNotNull("assembly");
            defaultLifestyle.RequiredNotNull("defaultLifestyle");

            var types = assembly.GetSelfImplementingTypes(instancePredicate: instancePredicate,
                                                          interfacePredicate: interfacePredicate,
                                                          onlyPublicInterfaces: onlyPublicInterfaces);


            foreach (var t in types)
            {
                if (NoAutoRegistrationAttribute.ExsitsOn(t.InstanceType) ||
                    NoAutoRegistrationAttribute.ExsitsOn(t.InterfaceType))
                {
                    continue;
                }

                var lifestyle = GetLifestyle(t.InstanceType,
                                             defaultLifestyle,
                                             customLifestyleSelector);

                container.Register(t.InterfaceType, t.InstanceType, lifestyle);
            }
        }