The current code is at [email protected]:castleproject/Windsor.git
On May 17, 2012, at 11:41 AM, Fabrice wrote: > > > On Thu, May 17, 2012 at 5:28 PM, Craig Neuwirt <[email protected]> wrote: > > It is certainly possible to do that and off the top of my head, I believe the > prior version did that. As mentioned above, that is the wrong behavior since > it would be inconsistent. > What I currently do is register the components with the general Scoped > lifestyle and explicitly control the boundary of the scope. The > Container/Kernel has a BeginScope extension method which will start the scope > and on disposal remove it. I then put hooks in ASP.NET to begin the scope. > I use that option to control my data access as well. > > > I can't use BeginScope because I don't have a strong reference to castle, my > application only use a IServiceProvider ... so I would like to only use > registration/configuration and let the component resolution as it is now. > > I've searched on how to create a custom lifestyle, but all sample I've found > is for previous Castle version > The best will be to use a sort of Composite lifestyle that take a main > lifestyle and one (or several) fallback lifestyle. It'll better to not > rewrite existing stuff (like PerWcfOperation & Transient) and instead reuse > it. > Do you have any tips on how to do that ? > You wouldn't necessarily need a new Lifestyle in this case, but a custom IScopeAccessor. The WcfOperationScopeAccesor used OperationContext.Current to stash the scope. You could implement your own IScopeAccessor (tiny interface) that accepts another accessor and if returns null Scope return a [ThreadStatic] DefaultifetimeScope. Of course, this will not be properly disposed and it will return a different instance than the one when the OperationContext.Current is available > I've tried to understand the code available in > https://github.com/castleproject/Castle.Facilities.Wcf-READONLY/tree/master/src/Castle.Facilities.WcfIntegration/Lifestyles > but I'm not sure it's the latest code for Castle 3 ? > > Thanks for your help > Fabrice > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
