AdvancedExtensionsGetItem Method

Simple Injector

Note: This API is now obsolete.

Retrieves an item from the container stored by the given key or null when no item is stored by that key.

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

[ObsoleteAttribute("Please use Container.ContainerScope.GetItem instead. Will be removed in version 6.0.", 
	true)]
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public static Object GetItem(
	this Container container,
	Object key
)

Parameters

container
Type: SimpleInjectorContainer
The container.
key
Type: SystemObject
The key of the item to retrieve.

Return Value

Type: Object
The stored item or null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Container. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the supplied arguments is a null reference.
Remarks

Thread-safety: Calls to this method are thread-safe, but users should take proper percussions when they call both GetItem and SetItem(Container, Object, Object).
See Also

Reference