ServiceHostExtensionsAddDependencyInjectionBehavior Method (ServiceHostBase, Type, ILifetimeScope) |
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
)
<ExtensionAttribute>
Public Shared Sub AddDependencyInjectionBehavior (
serviceHost As ServiceHostBase,
contractType As Type,
container As ILifetimeScope
)
Parameters
- serviceHost
- Type: System.ServiceModelServiceHostBase
The service host. - contractType
- Type: SystemType
The web service contract type. - container
- Type: AutofacILifetimeScope
The container.
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