RegistrationExtensionsRegisterApiControllers Method (ContainerBuilder, String, Assembly) |
Register types in the provided assemblies that implement IHttpController and
match the provided type name suffix.
Namespace:
Autofac.Integration.WebApi
Assembly:
Autofac.Integration.WebApi (in Autofac.Integration.WebApi.dll) Version: 6.0.0+03bf347ff3a78c2557675254b1a417eef4b464ec
Syntax public static IRegistrationBuilder<Object, ScanningActivatorData, DynamicRegistrationStyle> RegisterApiControllers(
this ContainerBuilder builder,
string controllerSuffix,
params Assembly[] controllerAssemblies
)
<ExtensionAttribute>
Public Shared Function RegisterApiControllers (
builder As ContainerBuilder,
controllerSuffix As String,
ParamArray controllerAssemblies As Assembly()
) As IRegistrationBuilder(Of Object, ScanningActivatorData, DynamicRegistrationStyle)
Parameters
- builder
- Type: AutofacContainerBuilder
The container builder. - controllerSuffix
- Type: SystemString
The type name suffix of the controllers. - controllerAssemblies
- Type: System.ReflectionAssembly
Assemblies to scan for controllers.
Return Value
Type:
IRegistrationBuilderObject,
ScanningActivatorData,
DynamicRegistrationStyleRegistration builder allowing the controller components to be customised.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ContainerBuilder. 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