Click or drag to resize

AutofacServiceProviderGetRequiredService Method

Gets service of type serviceType from the AutofacServiceProvider and requires it be present.

Namespace:  Autofac.Extensions.DependencyInjection
Assembly:  Autofac.Extensions.DependencyInjection (in Autofac.Extensions.DependencyInjection.dll) Version: 7.1.0+380b08798bf724f36e200e687129b44a0778ab92
Syntax
public Object GetRequiredService(
	Type serviceType
)

Parameters

serviceType
Type: SystemType
An object that specifies the type of service object to get.

Return Value

Type: Object
A service object of type serviceType.

Implements

ISupportRequiredService.GetRequiredService(Type)
Exceptions
ExceptionCondition
ComponentNotRegisteredException Thrown if the serviceType isn't registered with the container.
DependencyResolutionException Thrown if the object can't be resolved from the container.
See Also