Reputation: 11293
What's the difference between these two?
Component.For<IMyType>()
.LifeStyle
.PerWebRequest
.UsingFactoryMethod(() => new MyType());
and
Component.For<IMyType>()
.UsingFactoryMethod(() => new MyType())
.LifeStyle
.Is(LifestyleType.PerWebRequest);
Upvotes: 1
Views: 344
Reputation: 10260
They are the same. The only difference is that the API has been simplified (made less verbose, more direct). You can simplify it even further with Windsor 3:
Component.For<IMyType>()
.LifestylePerWebRequest()
.UsingFactoryMethod(() => new MyType());
Hope this helps!
Upvotes: 3