AppBuilder.Use Method

Adds a middleware node to the OWIN function pipeline. The middleware are invoked in the order they are added: the first middleware passed to Use will be the outermost function, and the last middleware passed to Use will be the innermost.

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

Syntax

'Declaration
Public Function Use ( _
    middleware As Object, _
    ParamArray args As Object() _
) As IAppBuilder
'Usage
Dim instance As AppBuilder 
Dim middleware As Object 
Dim args As Object()
Dim returnValue As IAppBuilder 

returnValue = instance.Use(middleware, _
    args)
public IAppBuilder Use(
    Object middleware,
    params Object[] args
)
public:
virtual IAppBuilder^ Use(
    Object^ middleware, 
    ... array<Object^>^ args
) sealed
abstract Use : 
        middleware:Object * 
        args:Object[] -> IAppBuilder  
override Use : 
        middleware:Object * 
        args:Object[] -> IAppBuilder
public final function Use(
    middleware : Object, 
    ... args : Object[]
) : IAppBuilder

Parameters

  • middleware
    Type: System.Object
    The middleware parameter determines which behavior is being chained into the pipeline. If the middleware given to Use is a Delegate, then it will be invoked with the "next app" in the chain as the first parameter. If the delegate takes more than the single argument, then the additional values must be provided to Use in the args array. If the middleware given to Use is a Type, then the public constructor will be invoked with the "next app" in the chain as the first parameter. The resulting object must have a public Invoke method. If the object has constructors which take more than the single "next app" argument, then additional values may be provided in the args array.
  • args
    Type: System.Object[]
    Any additional args passed to Use will be passed as additional values, following the "next app" parameter, when the OWIN call pipeline is build. They are passed as additional parameters if the middleware parameter is a Delegate, or as additional constructor arguments if the middle parameter is a Type.

Return Value

Type: IAppBuilder
The IAppBuilder itself is returned. This enables you to chain your use statements together.

Implements

IAppBuilderUse(Object, Object)

See Also

Reference

AppBuilder Class

Microsoft.Owin.Builder Namespace