 | ServiceContainerGetInstanceTService Method (String) |
Gets a named instance of the given service type.
Namespace: DigitalRune.ServiceLocationAssembly: DigitalRune.ServiceLocation (in DigitalRune.ServiceLocation.dll) Version: 1.3.0.0 (1.3.0.13596)
Syntaxpublic TService GetInstance<TService>(
string key
)
Public Function GetInstance(Of TService) (
key As String
) As TService
public:
generic<typename TService>
virtual TService GetInstance(
String^ key
) sealed
abstract GetInstance :
key : string -> 'TService
override GetInstance :
key : string -> 'TService
Parameters
- key
- Type: SystemString
The name the object was registered with. Can be or empty.
Type Parameters
- TService
- The type of the service requested.
Return Value
Type:
TService
The requested service instance or
if the service has not been
registered.
Implements
IServiceLocatorGetInstanceTService(String)
Exceptions
See Also