Click or drag to resize
ServiceResolveOptional Method (Type)
Returns an instance of serviceType as registered within the system or when no resolution is possible. Only services with Singleton or Transient are resolved.

Namespace: CMS.Core
Assembly: CMS.Core (in CMS.Core.dll) Version: 13.0.131
Syntax
C#
public static Object ResolveOptional(
	Type serviceType
)

Parameters

serviceType
Type: SystemType
Service type to be resolved.

Return Value

Type: Object
Returns an instance of serviceType or .
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when serviceType is null.
ServiceResolutionException Thrown when resolution of serviceType fails. This typically occurs when the implementing type has dependencies which cannot be satisfied.
See Also