LifestyleCreateHybrid Method

Simple Injector
Overload List

  NameDescription
Public methodStatic memberCode exampleCreateHybrid(ScopedLifestyle, Lifestyle)
The hybrid lifestyle allows mixing two lifestyles in a single registration. The hybrid will use the defaultLifestyle in case its GetCurrentScope method returns a scope; otherwise the fallbackLifestyle is used. The hybrid lifestyle will redirect the creation of the instance to the selected lifestyle. By nesting hybrid lifestyles, any number of lifestyles can be mixed.
Public methodStatic memberCode exampleCreateHybrid(ScopedLifestyle, ScopedLifestyle)
The hybrid lifestyle allows mixing two lifestyles in a single registration. The hybrid will use the defaultLifestyle in case its GetCurrentScope method returns a scope; otherwise the fallbackLifestyle is used. The hybrid lifestyle will redirect the creation of the instance to the selected lifestyle. By nesting hybrid lifestyles, any number of lifestyles can be mixed.
Public methodStatic memberCode exampleCreateHybrid(FuncBoolean, Lifestyle, Lifestyle)
The hybrid lifestyle allows mixing two lifestyles in a single registration. Based on the supplied lifestyleSelector delegate the hybrid lifestyle will redirect the creation of the instance to the correct lifestyle. The result of the lifestyleSelector delegate will not be cached; it is invoked each time an instance is requested or injected. By nesting hybrid lifestyles, any number of lifestyles can be mixed.
Public methodStatic memberCode exampleCreateHybrid(FuncBoolean, ScopedLifestyle, ScopedLifestyle)
The hybrid lifestyle allows mixing two lifestyles in a single registration. Based on the supplied lifestyleSelector delegate the hybrid lifestyle will redirect the creation of the instance to the correct lifestyle. The result of the lifestyleSelector delegate will not be cached; it is invoked each time an instance is requested or injected. By nesting hybrid lifestyles, any number of lifestyles can be mixed.
Top
See Also

Reference