C# Class Owin.Builder.AppBuilder

A standard implementation of IAppBuilder
Inheritance: IAppBuilder
显示文件 Open project: owin/museum-piece-owin-hosting Class Usage Examples

Public Methods

Method Description
AppBuilder ( ) : System

Build ( Type returnType ) : object

The Build is called at the point when all of the middleware should be chained together. This is typically done by the hosting component which created the app builder, and does not need to be called by the startup method if the IAppBuilder is passed in.

New ( ) : IAppBuilder

The New method creates a new instance of an IAppBuilder. This is needed to create a tree structure in your processing, rather than a linear pipeline. The new instance share the same Properties, but will be created with a new, empty middleware list. To create a tangent pipeline you would first call New, followed by several calls to Use on the new builder, ending with a call to Build on the new builder. The return value from Build will be the entry-point to your tangent pipeline. This entry-point may now be added to the main pipeline as an argument to a switching middleware, which will either call the tangent pipeline or the "next app", based on something in the request. That said - all of that work is typically hidden by a middleware like Map, which will do that for you.

Use ( object middleware ) : IAppBuilder

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.

Private Methods

Method Description
AddSignatureConversion ( Delegate conversion ) : void
AppBuilder ( Type>.IDictionary conversions, object>.IDictionary properties ) : System
BuildInternal ( Type signature ) : object
Convert ( Type signature, object app ) : object
ConvertMultiHop ( Type signature, object app ) : object
ConvertOneHop ( Type signature, object app ) : object
GetParameterType ( Delegate function ) : Type
TestArgForParameter ( Type parameterType, object arg ) : bool
ToConstructorMiddlewareFactory ( object middlewareObject, object args, Delegate &middlewareDelegate ) : Tuple
ToGeneratorMiddlewareFactory ( object middlewareObject, object args ) : Tuple
ToInstanceMiddlewareFactory ( object middlewareObject, object args ) : Tuple
ToMemberDelegate ( Type signature, object app ) : Delegate
ToMiddlewareFactory ( object middlewareObject, object args ) : Tuple

Method Details

AppBuilder() public method

public AppBuilder ( ) : System
return System

Build() public method

The Build is called at the point when all of the middleware should be chained together. This is typically done by the hosting component which created the app builder, and does not need to be called by the startup method if the IAppBuilder is passed in.
public Build ( Type returnType ) : object
returnType System.Type /// The Type argument indicates which calling convention should be returned, and /// is typically typeof() for the OWIN /// calling convention. ///
return object

New() public method

The New method creates a new instance of an IAppBuilder. This is needed to create a tree structure in your processing, rather than a linear pipeline. The new instance share the same Properties, but will be created with a new, empty middleware list. To create a tangent pipeline you would first call New, followed by several calls to Use on the new builder, ending with a call to Build on the new builder. The return value from Build will be the entry-point to your tangent pipeline. This entry-point may now be added to the main pipeline as an argument to a switching middleware, which will either call the tangent pipeline or the "next app", based on something in the request. That said - all of that work is typically hidden by a middleware like Map, which will do that for you.
public New ( ) : IAppBuilder
return IAppBuilder

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