Click or drag to resize

ServiceHelper.HasService Method

Checks whether a service provider has a given service.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 25.1.421.0 (25.1.421.0)
Syntax
public static bool HasService(
	IServiceProvider serviceProvider,
	Type serviceType
)

Parameters

serviceProvider
Type: System.IServiceProvider
The service provider from which to obtain the service.
serviceType
Type: System.Type
The type of the service that is requested.

Return Value

Type: Boolean
true if the service provider returns a non-null service of the given type.
Exceptions
ExceptionCondition
ArgumentNullException Thrown when serviceProvider or serviceType is null.
See Also