private static GenericFamilyExpression ApplyLifestyleSingle(GenericFamilyExpression registration, Lifestyle lifestyle)
        {
            if (lifestyle.Name == Lifestyle.Singleton.Name)
                return registration.Singleton();

            if (lifestyle.Name == Lifestyle.Transient.Name)
                return registration.LifecycleIs(InstanceScope.PerRequest);

            if (lifestyle.Name == Lifestyle.PerWebRequest.Name)
                return registration.HttpContextScoped();

            if (lifestyle.Name == Lifestyle.Unmanaged.Name)
                return registration;

            if (lifestyle.Name == Lifestyle.ProviderDefault.Name)
                return registration;

            if (lifestyle.Name == Lifestyle.Default.Name)
                return registration.Singleton();

            throw new ArgumentException(string.Format("Unknown lifestyle : {0}", lifestyle), "lifestyle");
        }