ContainerGetCurrentRegistrations Method

Simple Injector
Returns an array with the current registrations. This list contains all explicitly registered types, and all implicitly registered instances. Implicit registrations are all concrete unregistered types that have been requested, all types that have been resolved using unregistered type resolution (using the ResolveUnregisteredType event), and requested unregistered collections. Note that the result of this method may change over time, because of these implicit registrations.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax

public InstanceProducer[] GetCurrentRegistrations()

Return Value

Type: InstanceProducer
An array of InstanceProducer instances.
Remarks

This method has a performance characteristic of O(n). Prevent from calling this in a performance critical path of the application.

Note: This method is not guaranteed to always return the same InstanceProducer instance for a given registration. It will however either always return a producer that is able to return the expected instance. Because of this, do not compare sets of instances returned by different calls to GetCurrentRegistrations by reference. The way of comparing lists is by the actual type. The type of each instance is guaranteed to be unique in the returned list.

See Also

Reference