Skip to content

Instantly share code, notes, and snippets.

@kkozmic
Created March 10, 2011 08:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkozmic/863736 to your computer and use it in GitHub Desktop.
Save kkozmic/863736 to your computer and use it in GitHub Desktop.
Scoped lifestyle in Windsor
[Test]
public void Implicitly_graph_scoped_component_instances_are_reused()
{
Container.Register(
Component.For<A>().LifeStyle.ScopedPer<CBA>(),
Component.For<B>().LifeStyle.Transient,
Component.For<CBA>().LifeStyle.Transient);
var cba = Container.Resolve<CBA>();
Assert.AreSame(cba.A, cba.B.A);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment