简体   繁体   中英

Can the default lifestyle of Castle Windsor registered components be changed?

The Castle Windsor documentation shows that Singleton is the default lifestyle for registered components.

Is it possible to change the default lifestyle such that by default, a registered component will have a transient lifestyle?

Not sure if possible or not but what you can do is add an "IContributeComponentModelConstruction" to set all components to a specific lifestyle.

Check this: http://blog.ploeh.dk/2010/04/26/ChangingWindsorlifestylesafterthefact/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM