Autofac .NET Inversion of Control Container
ResolveOptional Method (context, serviceType, parameters)
NamespacesAutofacResolutionExtensionsResolveOptional(IComponentContext, Type, array<Parameter>[]()[])
Retrieve a service from the context, or null if the service is not registered.
Declaration Syntax
C#Visual BasicVisual C++
public static Object ResolveOptional(
	IComponentContext context,
	Type serviceType,
	params Parameter[] parameters
)
Public Shared Function ResolveOptional ( _
	context As IComponentContext, _
	serviceType As Type, _
	ParamArray parameters As Parameter() _
) As Object
public:
static Object^ ResolveOptional(
	IComponentContext^ context, 
	Type^ serviceType, 
	... array<Parameter^>^ parameters
)
Parameters
context (IComponentContext)
The context from which to resolve the service.
serviceType (Type)
The type of the service.
parameters (array< Parameter >[]()[])
Parameters for the service.
Return Value
The component instance that provides the service, or null.
Exceptions

Assembly: Autofac (Module: Autofac) Version: 2.1.13.813 (2.1.13.813)