Click or drag to resize

ServiceHelper.LocateService Method (Type, Object)

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

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 Object LocateService(
	Type serviceType,
	Object candidate
)

Parameters

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

Return Value

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