RegistrationExtensionsAsWebApiExceptionFilterOverrideWhere Method (IRegistrationBuilderObject, IConcreteActivatorData, SingleRegistrationStyle, FuncILifetimeScope, HttpActionDescriptor, Boolean, FilterScope) |
Sets the provided registration to act as an
IAutofacExceptionFilter override, based on a predicate that filters which actions it is applied to.
Namespace:
Autofac.Integration.WebApi
Assembly:
Autofac.Integration.WebApi (in Autofac.Integration.WebApi.dll) Version: 6.0.0+03bf347ff3a78c2557675254b1a417eef4b464ec
Syntax public static IRegistrationBuilder<Object, IConcreteActivatorData, SingleRegistrationStyle> AsWebApiExceptionFilterOverrideWhere(
this IRegistrationBuilder<Object, IConcreteActivatorData, SingleRegistrationStyle> registration,
Func<ILifetimeScope, HttpActionDescriptor, bool> predicate,
FilterScope filterScope = FilterScope.Action
)
<ExtensionAttribute>
Public Shared Function AsWebApiExceptionFilterOverrideWhere (
registration As IRegistrationBuilder(Of Object, IConcreteActivatorData, SingleRegistrationStyle),
predicate As Func(Of ILifetimeScope, HttpActionDescriptor, Boolean),
Optional filterScope As FilterScope = FilterScope.Action
) As IRegistrationBuilder(Of Object, IConcreteActivatorData, SingleRegistrationStyle)
Parameters
- registration
- Type: Autofac.BuilderIRegistrationBuilderObject, IConcreteActivatorData, SingleRegistrationStyle
The registration. - predicate
- Type: SystemFuncILifetimeScope, HttpActionDescriptor, Boolean
A predicate that should return true if this filter should be applied to the specified action. - filterScope (Optional)
- Type: FilterScope
The scope to apply the filter at (only Controller and Action supported).
Return Value
Type:
IRegistrationBuilderObject,
IConcreteActivatorData,
SingleRegistrationStyleA 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
IRegistrationBuilderObject,
IConcreteActivatorData,
SingleRegistrationStyle. 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