AppBuilder.Use Method (Object, Object[])

 

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

public IAppBuilder Use(
    object middleware,
    params object[] args
)
public:
virtual IAppBuilder^ Use(
    Object^ middleware,
    ... array<Object^>^ args
) sealed
abstract Use : 
        middleware:Object *
        [<ParamArrayAttribute>] args:Object[] -> IAppBuilder
override Use : 
        middleware:Object *
        [<ParamArrayAttribute>] args:Object[] -> IAppBuilder
Public Function Use (
    middleware As Object,
    ParamArray args As Object()
) As 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: Owin.IAppBuilder

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

Implements

IAppBuilder.Use(Object, Object[])

See Also

AppBuilder Class
Microsoft.Owin.Builder Namespace

Return to top