ContainerRegisterConditional Method

Simple Injector
Overload List

  NameDescription
Public methodRegisterConditionalTService, TImplementation(PredicatePredicateContext)
Conditionally registers that a new instance of TImplementation will be returned every time a TService is requested (transient) and where the supplied predicate returns true. The predicate will only be evaluated a finite number of times; the predicate is unsuited for making decisions based on runtime conditions.
Public methodRegisterConditionalTService, TImplementation(Lifestyle, PredicatePredicateContext)
Conditionally registers that an instance of TImplementation will be returned every time a TService is requested and where the supplied predicate returns true. The instance is cached according to the supplied lifestyle. The predicate will only be evaluated a finite number of times; the predicate is unsuited for making decisions based on runtime conditions.
Public methodRegisterConditionalTService(Registration, PredicatePredicateContext)
Conditionally registers that registration will be used every time a TService requested and where the supplied predicate returns true. The predicate will only be evaluated a finite number of times; the predicate is unsuited for making decisions based on runtime conditions.
Public methodRegisterConditional(Type, Registration, PredicatePredicateContext)
Conditionally registers that registration will be used every time a serviceType is requested and where the supplied predicate returns true. The predicate will only be evaluated a finite number of times; the predicate is unsuited for making decisions based on runtime conditions.
Public methodRegisterConditional(Type, Type, PredicatePredicateContext)
Conditionally registers that a new instance of implementationType will be returned every time a serviceType is requested (transient) and where the supplied predicate returns true. The predicate will only be evaluated a finite number of times; the predicate is unsuited for making decisions based on runtime conditions.
Public methodRegisterConditional(Type, FuncTypeFactoryContext, Type, Lifestyle, PredicatePredicateContext)
Conditionally registers that an instance of the type returned from implementationTypeFactory will be returned every time a serviceType is requested and where the supplied predicate returns true. The instance is cached according to the supplied lifestyle. Both the predicate and implementationTypeFactory will only be evaluated a finite number of times; they unsuited for making decisions based on runtime conditions.
Public methodRegisterConditional(Type, Type, Lifestyle, PredicatePredicateContext)
Conditionally registers that an instance of implementationType will be returned every time a serviceType is requested and where the supplied predicate returns true. The instance is cached according to the supplied lifestyle. The predicate will only be evaluated a finite number of times; the predicate is unsuited for making decisions based on runtime conditions.
Top
See Also

Reference