Click or drag to resize

CurrentGetRequiredServiceT, U Method

Gets the required service. The service is primarily being searched with key T. If it is not found with this key, it is search with key U, thus U has to be a base class or an interface of type T. If the service is found with this second key U and is of type T, the service will be register with the key T in order to avoid further searching.

Namespace: Altaxo
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static T GetRequiredService<T, U>()
where T : U

Type Parameters

T
Type of the service to be searched.
U
Base class type or interface type of type T.

Return Value

T
Service that is of type T. If no such service is found, an exception is thrown.
Exceptions
ExceptionCondition
ServiceNotFoundExceptionIf a service of type T was not found.
See Also