ContainerRegisterDecorator Method

Simple Injector
Overload List

  NameDescription
Public methodCode exampleRegisterDecoratorTService, TDecorator
Ensures that the supplied TDecorator decorator is returned, wrapping the original registered TService, by injecting that service type into the constructor of the supplied TDecorator. Multiple decorators may be applied to the same TService. By default, a new TDecorator instance will be returned on each request (according the Transient lifestyle), independently of the lifestyle of the wrapped service.
Public methodCode exampleRegisterDecoratorTService, TDecorator(Lifestyle)
Ensures that the supplied TDecorator decorator is returned and cached with the given lifestyle, wrapping the original registered TService, by injecting that service type into the constructor of the supplied TDecorator. Multiple decorators may be applied to the same TService. Decorators can be applied to both open, closed, and non-generic service types.
Public methodCode exampleRegisterDecorator(Type, Type)
Ensures that the supplied decoratorType decorator is returned, wrapping the original registered serviceType, by injecting that service type into the constructor of the supplied decoratorType. Multiple decorators may be applied to the same serviceType. Decorators can be applied to both open, closed, and non-generic service types. By default, a new decoratorType instance will be returned on each request (according the Transient lifestyle), independently of the lifestyle of the wrapped service.
Public methodCode exampleRegisterDecorator(Type, Type, Lifestyle)
Ensures that the supplied decoratorType decorator is returned and cached with the given lifestyle, wrapping the original registered serviceType, by injecting that service type into the constructor of the supplied decoratorType. Multiple decorators may be applied to the same serviceType. Decorators can be applied to both open, closed, and non-generic service types.
Public methodCode exampleRegisterDecorator(Type, Type, PredicateDecoratorPredicateContext)
Ensures that the supplied decoratorType decorator is returned when the supplied predicate returns true, wrapping the original registered serviceType, by injecting that service type into the constructor of the supplied decoratorType. Multiple decorators may be applied to the same serviceType. Decorators can be applied to both open, closed, and non-generic service types. By default, a new decoratorType instance will be returned on each request (according the Transient lifestyle), independently of the lifestyle of the wrapped service.
Public methodCode exampleRegisterDecorator(Type, FuncDecoratorPredicateContext, Type, Lifestyle, PredicateDecoratorPredicateContext)
Ensures that the decorator type that is returned from decoratorTypeFactory is supplied when the supplied predicate returns true and cached with the given lifestyle, wrapping the original registered serviceType, by injecting that service type into the constructor of the decorator type that is returned by the supplied decoratorTypeFactory. Multiple decorators may be applied to the same serviceType. Decorators can be applied to both open, closed, and non-generic service types.
Public methodCode exampleRegisterDecorator(Type, Type, Lifestyle, PredicateDecoratorPredicateContext)
Ensures that the supplied decoratorType decorator is returned when the supplied predicate returns true and cached with the given lifestyle, wrapping the original registered serviceType, by injecting that service type into the constructor of the supplied decoratorType. Multiple decorators may be applied to the same serviceType. Decorators can be applied to both open, closed, and non-generic service types.
Top
See Also

Reference