Giter Site home page Giter Site logo

castle.windsor.lifestyles's People

Contributors

alexanderkot avatar gschuager avatar mausch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

castle.windsor.lifestyles's Issues

Mixing PerWebRequest and Scoped

Hello,

is there any option to have a HybridPerWebRequestPerScope lifestyle?
I'm using NServiceBus inside a WebApplication and I need some components to live both in the web app (PerWebRequest) and in the message handling scope generated by NSB per received message.

cheers,
.m

Question - How to use these lifestyles with the Classes.FromAssembly registration method?

Hi there, thanks for these lifestyles!

I can easily use them the Component.For registration method like so:

container.Register(Component.For<IUserStore<ApplicationUser, int>>().ImplementedBy<UserStore>().LifeStyle.HybridPerWebRequestPerThread());

But how do I use them with the Classes.FromAssembly registration method?

container.Register(Classes.FromAssembly(Assembly.GetAssembly(typeof(Manager<>))).BasedOn(typeof(Manager<>)).LifestylePerWebRequest());

This returns BasedOnDescriptor instead of ComponentRegistration, so I'm not sure how to use these lifestyles with this registration.

Thanks for any insight,
Pete

Lifestyle.HybridPerWebRequestPerThread() replacement?

Hello,

Now that this module is deprecated, what is the suggested replacement for Lifestyle.HybridPerWebRequestPerThread()? I think I will switch to LifestylePerWebRequest() but am nervous because this affects our database context. Thanks!

How to set Hybrid Lifestyle as the LifeStyleType

Hey

I can see how to register a single type but we set the entire web site to use PerWebRequest as per this post - http://blog.ploeh.dk/2010/04/26/ChangingWindsorlifestylesafterthefact/

In that case, we need to explicitly set the "LifeStyleType" propertly on the ComponentModel.
I'm not sure what I would set this to - and what else to do - in order to spread the Hybrid lifestyle

public class SingletonEqualizer : IContributeComponentModelConstruction
{
    public void ProcessModel(IKernel kernel, ComponentModel model)
    {
        model.LifestyleType = LifestyleType.Singleton; // what to set this to?
    }
}

I've tried below, but there's no ILifestyleManager for PerWebRequest (and I understand Windsor 3 now uses new ScopedLifestyleManager(new WebRequestScopeAccessor()

So how to encapsulate that, I really don't know - something like below, if ScopedLifestyle had a way of specifying the underlying type without newing it up)

model.CustomLifestyle = typeof(HybridLifestyleManager<ScopedLifestyleManager>, TransientLifestyleManager>);

Constructor on type 'Castle.MicroKernel.Lifestyle.HybridLifestyleManager`2[[Castle.MicroKernel.Lifestyle.ScopedLifestyleManager, Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc],[Castle.MicroKernel.Lifestyle.TransientLifestyleManager, Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc]]' not found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.