Thank you, Xavier!
On Friday, September 12, 2014 2:08:17 AM UTC-5, Xavier wrote:
1) add container.AddFacilityTypedFactoryFacility();
2) modifiy the factory registration:
container.Register(Component.ForIWindsorFactory().AsFactory().Named(IWindsorFactory));
3) just keep the IWindsorFactory
From the documentation, it states: Transient lifestyle is a good choice
when you want to be in control of instance's lifetime of the instances.
When you need new instance, with new state every time.
When I run the following test, though, it would seem this is not the case.
If I run the
the bug is in your test code.
the 'i' variable is not captured in the thread's closure so all 10 threads
gets i=10 (confirm by console.writeline(i) in the thread lambda)
Ken Egozi.
http://kenegozi.com/blog
http://aspnetwebstack.codeplex.com
http://www.windowsazure.com/en-us/develop/mobile/
you can fix the test by adding this in the first row of the for loop
var localI = i;
and then change jp.ID=i; to jp.ID=localI;
Ken Egozi.
http://kenegozi.com/blog
http://aspnetwebstack.codeplex.com
http://www.windowsazure.com/en-us/develop/mobile/
http://www.shopyourway.com
Much easier test is to use Object.ReferenceEqual to compare the created
instances.
On Tue, Sep 16, 2014 at 11:15 AM, 'Michael' via Castle Project Users
castle-project-users@googlegroups.com wrote:
From the documentation, it states: Transient lifestyle is a good choice
when you want to be in