Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Castle Windsor Lifestle Override
public class PerWebRequestLifestyleOverrider : IContributeComponentModelConstruction
{
public void ProcessModel(IKernel kernel, ComponentModel model)
{
if (model.LifestyleType == LifestyleType.PerWebRequest)
{
model.LifestyleType = LifestyleType.Singleton;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment