RegistrationExtensionsRegisterWebApiModelBinders Method |
Note: This API is now obsolete.
Register types that implement IModelBinder in the provided assemblies.
Namespace:
Autofac.Integration.WebApi
Assembly:
Autofac.Integration.WebApi (in Autofac.Integration.WebApi.dll) Version: 6.0.0+03bf347ff3a78c2557675254b1a417eef4b464ec
Syntax[ObsoleteAttribute("Use the AsModelBinderForTypes() registration extension to register model binders and be sure to RegisterWebApiModelBinderProvider() in your container if you do. This method doesn't connect the model binders to the Autofac binder provider. It will be removed in a future version.")]
public static IRegistrationBuilder<Object, ScanningActivatorData, DynamicRegistrationStyle> RegisterWebApiModelBinders(
this ContainerBuilder builder,
params Assembly[] modelBinderAssemblies
)
<ExtensionAttribute>
<ObsoleteAttribute("Use the AsModelBinderForTypes() registration extension to register model binders and be sure to RegisterWebApiModelBinderProvider() in your container if you do. This method doesn't connect the model binders to the Autofac binder provider. It will be removed in a future version.")>
Public Shared Function RegisterWebApiModelBinders (
builder As ContainerBuilder,
ParamArray modelBinderAssemblies As Assembly()
) As IRegistrationBuilder(Of Object, ScanningActivatorData, DynamicRegistrationStyle)
Parameters
- builder
- Type: AutofacContainerBuilder
The container builder. - modelBinderAssemblies
- Type: System.ReflectionAssembly
Assemblies to scan for model binders.
Return Value
Type:
IRegistrationBuilderObject,
ScanningActivatorData,
DynamicRegistrationStyleA registration builder allowing further configuration of the component.
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).
Exceptions
See Also