Click or drag to resize

ServiceHelperLocateService Method (Type, Object)

Convenience method for implementing IServiceProvider objects. If candidate is an instance of serviceType, returns candidate, otherwise returns .

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public static Object LocateService(
	Type serviceType,
	Object candidate
)

Parameters

serviceType
Type: SystemType
The type of the service that is requested.
candidate
Type: SystemObject
A candidate object that could be of the requested serviceType.

Return Value

Type: Object
candidate if it is of type serviceType; otherwise .
Exceptions
ExceptionCondition
ArgumentNullException Thrown when serviceType or candidate is .
See Also