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
Syntax
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

Parameters

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

Type Parameters

TLimit
Registration limit type.
TActivatorData
Activator data type.
TRegistrationStyle
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).
Exceptions
ExceptionCondition
ArgumentNullException Thrown if registration or types is .
ArgumentException Thrown if types is empty or contains all values.
See Also