Click or drag to resize

RegistrationExtensionsAsModelBinderForTypesTLimit, TActivatorData, TRegistrationStyle Method

Sets a provided registration to act as an IModelBinder for the specified list of types.

Namespace:  Autofac.Integration.WebApi
Assembly:  Autofac.Integration.WebApi (in Autofac.Integration.WebApi.dll) Version: 6.0.0+03bf347ff3a78c2557675254b1a417eef4b464ec
public static IRegistrationBuilder<TLimit, TActivatorData, TRegistrationStyle> AsModelBinderForTypes<TLimit, TActivatorData, TRegistrationStyle>(
	this IRegistrationBuilder<TLimit, TActivatorData, TRegistrationStyle> registration,
	params Type[] types
where TActivatorData : IConcreteActivatorData
where TRegistrationStyle : SingleRegistrationStyle


Type: Autofac.BuilderIRegistrationBuilderTLimit, TActivatorData, TRegistrationStyle
The registration for the type or object instance that will act as the model binder.
Type: SystemType
The list of model Type for which the registration should be a model binder.

Type Parameters

Registration limit type.
Activator data type.
Registration style.

Return Value

Type: IRegistrationBuilderTLimit, TActivatorData, TRegistrationStyle
An Autofac registration that can be modified as needed.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRegistrationBuilderTLimit, TActivatorData, TRegistrationStyle. 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).
ArgumentNullException Thrown if registration or types is .
ArgumentException Thrown if types is empty or contains all values.
See Also