Click or drag to resize

ServiceHostExtensionsAddDependencyInjectionBehavior Method (ServiceHostBase, Type, ILifetimeScope, IEnumerableParameter)

Adds the custom service behavior required for dependency injection.

Namespace:  Autofac.Integration.Wcf
Assembly:  Autofac.Integration.Wcf (in Autofac.Integration.Wcf.dll) Version: 6.0.0+691de191498a27e1db2c331d318e19150e41288c
Syntax
public static void AddDependencyInjectionBehavior(
	this ServiceHostBase serviceHost,
	Type contractType,
	ILifetimeScope container,
	IEnumerable<Parameter> parameters
)

Parameters

serviceHost
Type: System.ServiceModelServiceHostBase
The service host.
contractType
Type: SystemType
The web service contract type.
container
Type: AutofacILifetimeScope
The container.
parameters
Type: System.Collections.GenericIEnumerableParameter
Parameters for the instance.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ServiceHostBase. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also