Owin.Builder.AppBuilder.Use C# (CSharp) Method

Use() public 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.
public Use ( object middleware ) : IAppBuilder
middleware 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. ///
return IAppBuilder
        public IAppBuilder Use(object middleware, params object[] args)
        {
            _middleware.Add(ToMiddlewareFactory(middleware, args));
            return this;
        }