How to upgrade Castle.windsor from version 4 to version 5.0.1

370 Views Asked by At

While upgrading Castle.Windsor to version 5, I found out that the PerWebRequest is removed from LifestyleTypes enum.

In my application I am registering the components with different lifestyles like this

private static void RegisterComponents(LifeStypleType defaultLifestyleType) {
    container.Register(Component.For<IProjectService>()
             .ImplementedBy<ProjectService>()
             .LifeStyle.Is(defaultLifestyleType));
}

On another page I am creating the Container like

_windsorContainer = RegisterComponents(LifestyleType.PerWebRequest);

_windsorContainer2 = RegisterComponents(LifestyleType.Singleton);

Is there any way to use LifestyleType.PerWebRequest in Castle.Windsor version 5?

0

There are 0 best solutions below