MapWhenExtensions.MapWhen Method

Branches the request pipeline based on the result of the given predicate.

Namespace:  Owin
Assembly:  Microsoft.Owin (in Microsoft.Owin.dll)


<ExtensionAttribute> _
Public Shared Function MapWhen ( _
    app As IAppBuilder, _
    predicate As Func(Of IOwinContext, Boolean), _
    configuration As Action(Of IAppBuilder) _
) As IAppBuilder
Dim app As IAppBuilder 
Dim predicate As Func(Of IOwinContext, Boolean)
Dim configuration As Action(Of IAppBuilder)
Dim returnValue As IAppBuilder 

returnValue = app.MapWhen(predicate, _
public static IAppBuilder MapWhen(
    this IAppBuilder app,
    Func<IOwinContext, bool> predicate,
    Action<IAppBuilder> configuration
static IAppBuilder^ MapWhen(
    IAppBuilder^ app, 
    Func<IOwinContext^, bool>^ predicate, 
    Action<IAppBuilder^>^ configuration
static member MapWhen : 
        app:IAppBuilder * 
        predicate:Func<IOwinContext, bool> * 
        configuration:Action<IAppBuilder> -> IAppBuilder
public static function MapWhen(
    app : IAppBuilder, 
    predicate : Func<IOwinContext, boolean>, 
    configuration : Action<IAppBuilder>
) : IAppBuilder


  • app
    Type: IAppBuilder
  • configuration
    Type: System.Action<IAppBuilder>
    Configures a branch to take

Return Value

Type: IAppBuilder

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAppBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see or

See Also


MapWhenExtensions Class

Owin Namespace