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.CoreAssembly: CMS.Core (in CMS.Core.dll) Version: 13.0.131
Syntax public static Object ResolveOptional(
Type serviceType
)
Parameters
- serviceType
- Type: SystemType
Service type to be resolved.
Return Value
Type:
ObjectReturns an instance of
serviceType or
.
Exceptions Exception | Condition |
---|
ArgumentNullException | Thrown 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