IApplicationBuilder Interface

Definition

Defines a class that provides the mechanisms to configure an application's request pipeline.

public interface IApplicationBuilder
Derived

Properties

ApplicationServices

Gets or sets the IServiceProvider that provides access to the application's service container.

Properties

Gets a key/value collection that can be used to share data between middleware.

ServerFeatures

Gets the set of HTTP features the application's server provides.

Methods

Build()

Builds the delegate used by this application to process HTTP requests.

New()

Creates a new IApplicationBuilder that shares the Properties of this IApplicationBuilder.

Use(Func<RequestDelegate,RequestDelegate>)

Adds a middleware delegate to the application's request pipeline.

Extension Methods

UseRequestLocalization(IApplicationBuilder)

Adds the RequestLocalizationMiddleware to automatically set culture information for requests based on information provided by the client.

UseRequestLocalization(IApplicationBuilder, RequestLocalizationOptions)

Adds the RequestLocalizationMiddleware to automatically set culture information for requests based on information provided by the client.

UseAuthentication(IApplicationBuilder)

Adds the AuthenticationMiddleware to the specified IApplicationBuilder, which enables authentication capabilities.

UseBrowserLink(IApplicationBuilder)

This method is called to enable Browser Link in an application. It registers a factory method that creates BrowserLinkMiddleware for each request.

UseIdentity(IApplicationBuilder)

This method is obsolete and will be removed in a future version. The recommended alternative is UseAuthentication(IApplicationBuilder)

Enables ASP.NET identity for the current application.

UseClaimsTransformation(IApplicationBuilder)

Adds the ClaimsTransformationMiddleware middleware to the specified IApplicationBuilder, which enables claims transformation capabilities.

UseClaimsTransformation(IApplicationBuilder, ClaimsTransformationOptions)

Adds the ClaimsTransformationMiddleware middleware to the specified IApplicationBuilder, which enables claims transformation capabilities.

UseClaimsTransformation(IApplicationBuilder, Func<ClaimsTransformationContext,Task<ClaimsPrincipal>>)

Adds the ClaimsTransformationMiddleware middleware to the specified IApplicationBuilder, which enables claims transformation capabilities.

UseCookieAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseCookieAuthentication(IApplicationBuilder, CookieAuthenticationOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseCookieAuthentication(IApplicationBuilder, CookieAuthenticationOptions)

Adds the CookieAuthenticationMiddleware middleware to the specified IApplicationBuilder, which enables cookie authentication capabilities.

UseCookiePolicy(IApplicationBuilder)

Adds the CookiePolicyMiddleware handler to the specified IApplicationBuilder, which enables cookie policy capabilities.

UseCookiePolicy(IApplicationBuilder, CookiePolicyOptions)

Adds the CookiePolicyMiddleware handler to the specified IApplicationBuilder, which enables cookie policy capabilities.

UseCors(IApplicationBuilder, Action<CorsPolicyBuilder>)

Adds a CORS middleware to your web application pipeline to allow cross domain requests.

UseCors(IApplicationBuilder, String)

Adds a CORS middleware to your web application pipeline to allow cross domain requests.

UseDefaultFiles(IApplicationBuilder)

Enables default file mapping on the current path

UseDefaultFiles(IApplicationBuilder, DefaultFilesOptions)

Enables default file mapping with the given options

UseDefaultFiles(IApplicationBuilder, String)

Enables default file mapping for the given request path

UseDeveloperExceptionPage(IApplicationBuilder)

Captures synchronous and asynchronous Exception instances from the pipeline and generates HTML error responses.

UseDeveloperExceptionPage(IApplicationBuilder, DeveloperExceptionPageOptions)

Captures synchronous and asynchronous Exception instances from the pipeline and generates HTML error responses.

UseDirectoryBrowser(IApplicationBuilder)

Enable directory browsing on the current path

UseDirectoryBrowser(IApplicationBuilder, DirectoryBrowserOptions)

Enable directory browsing with the given options

UseDirectoryBrowser(IApplicationBuilder, String)

Enables directory browsing for the given request path

UseElmCapture(IApplicationBuilder)

Enables the Elm logging service, which can be accessed via the ElmPageMiddleware.

UseElmPage(IApplicationBuilder)

Enables viewing logs captured by the ElmCaptureMiddleware.

UseExceptionHandler(IApplicationBuilder)

Adds a middleware to the pipeline that will catch exceptions, log them, and re-execute the request in an alternate pipeline. The request will not be re-executed if the response has already started.

UseExceptionHandler(IApplicationBuilder, ExceptionHandlerOptions)

Adds a middleware to the pipeline that will catch exceptions, log them, and re-execute the request in an alternate pipeline. The request will not be re-executed if the response has already started.

UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>)

Adds a middleware to the pipeline that will catch exceptions, log them, and re-execute the request in an alternate pipeline. The request will not be re-executed if the response has already started.

UseExceptionHandler(IApplicationBuilder, String)

Adds a middleware to the pipeline that will catch exceptions, log them, reset the request path, and re-execute the request. The request will not be re-executed if the response has already started.

UseFacebookAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseFacebookAuthentication(IApplicationBuilder, FacebookOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseFacebookAuthentication(IApplicationBuilder, FacebookOptions)

Adds the FacebookMiddleware middleware to the specified IApplicationBuilder, which enables Facebook authentication capabilities.

UseFileServer(IApplicationBuilder)

Enable all static file middleware (except directory browsing) for the current request path in the current directory.

UseFileServer(IApplicationBuilder, FileServerOptions)

Enable all static file middleware with the given options

UseFileServer(IApplicationBuilder, Boolean)

Enable all static file middleware on for the current request path in the current directory.

UseFileServer(IApplicationBuilder, String)

Enables all static file middleware (except directory browsing) for the given request path from the directory of the same name

UseForwardedHeaders(IApplicationBuilder)

Forwards proxied headers onto current request

UseForwardedHeaders(IApplicationBuilder, ForwardedHeadersOptions)

Forwards proxied headers onto current request

UseGoogleAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseGoogleAuthentication(IApplicationBuilder, GoogleOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseGoogleAuthentication(IApplicationBuilder, GoogleOptions)

Adds the GoogleMiddleware middleware to the specified IApplicationBuilder, which enables Google authentication capabilities.

UseHttpMethodOverride(IApplicationBuilder)

Allows incoming POST request to override method type with type specified in header.

UseHttpMethodOverride(IApplicationBuilder, HttpMethodOverrideOptions)

Allows incoming POST request to override method type with type specified in form.

UseJwtBearerAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)

Adds the JwtBearerMiddleware middleware to the specified IApplicationBuilder, which enables Bearer token processing capabilities. This middleware understands appropriately formatted and secured tokens which appear in the request header. If the Options.AuthenticationMode is Active, the claims within the bearer token are added to the current request's IPrincipal User. If the Options.AuthenticationMode is Passive, then the current request is not modified, but IAuthenticationManager AuthenticateAsync may be used at any time to obtain the claims from the request's bearer token. See also http://tools.ietf.org/html/rfc6749

Map(IApplicationBuilder, PathString, Action<IApplicationBuilder>)

Branches the request pipeline based on matches of the given request path. If the request path starts with the given path, the branch is executed.

MapWhen(IApplicationBuilder, Func<HttpContext,Boolean>, Action<IApplicationBuilder>)

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

UseMicrosoftAccountAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseMicrosoftAccountAuthentication(IApplicationBuilder, MicrosoftAccountOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseMicrosoftAccountAuthentication(IApplicationBuilder, MicrosoftAccountOptions)

Adds the MicrosoftAccountMiddleware middleware to the specified IApplicationBuilder, which enables Microsoft Account authentication capabilities.

UseMvc(IApplicationBuilder)

Adds MVC to the IApplicationBuilder request execution pipeline.

UseMvc(IApplicationBuilder, Action<IRouteBuilder>)

Adds MVC to the IApplicationBuilder request execution pipeline.

UseMvcWithDefaultRoute(IApplicationBuilder)

Adds MVC to the IApplicationBuilder request execution pipeline with a default route named 'default' and the following template: '{controller=Home}/{action=Index}/{id?}'.

UseOAuthAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseOAuthAuthentication(IApplicationBuilder, OAuthOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseOAuthAuthentication(IApplicationBuilder, OAuthOptions)

Adds the OAuthMiddleware<TOptions> middleware to the specified IApplicationBuilder, which enables OAuth 2.0 authentication capabilities.

UseOpenIdConnectAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseOpenIdConnectAuthentication(IApplicationBuilder, OpenIdConnectOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseOpenIdConnectAuthentication(IApplicationBuilder, OpenIdConnectOptions)

Adds the OpenIdConnectMiddleware middleware to the specified IApplicationBuilder, which enables OpenID Connect authentication capabilities.

UseOwin(IApplicationBuilder)
UseOwin(IApplicationBuilder, Action<Action<Func<Func<IDictionary<String,Object>,Task>,Func<IDictionary<String,Object>,Task>>>>)
RunProxy(IApplicationBuilder)

Sends request to remote server as specified in options

RunProxy(IApplicationBuilder, ProxyOptions)

Sends request to remote server as specified in options

UseResponseBuffering(IApplicationBuilder)

Enables full buffering of response bodies. This can be disabled on a per request basis using IHttpBufferingFeature.

UseResponseCaching(IApplicationBuilder)
UseResponseCompression(IApplicationBuilder)

Adds middleware for dynamically compressing HTTP Responses.

UseRewriter(IApplicationBuilder)

Checks if a given Url matches rules and conditions, and modifies the HttpContext on match.

UseRewriter(IApplicationBuilder, RewriteOptions)

Checks if a given Url matches rules and conditions, and modifies the HttpContext on match.

UseRouter(IApplicationBuilder, IRouter)

Adds a RouterMiddleware middleware to the specified IApplicationBuilder with the specified IRouter.

UseRouter(IApplicationBuilder, Action<IRouteBuilder>)

Adds a RouterMiddleware middleware to the specified IApplicationBuilder with the IRouter built from configured IRouteBuilder.

Run(IApplicationBuilder, RequestDelegate)

Adds a terminal middleware delegate to the application's request pipeline.

UseSession(IApplicationBuilder)

Adds the SessionMiddleware to automatically enable session state for the application.

UseSession(IApplicationBuilder, SessionOptions)

Adds the SessionMiddleware to automatically enable session state for the application.

UseStaticFiles(IApplicationBuilder)

Enables static file serving for the current request path

UseStaticFiles(IApplicationBuilder, StaticFileOptions)

Enables static file serving with the given options

UseStaticFiles(IApplicationBuilder, String)

Enables static file serving for the given request path

UseStatusCodePages(IApplicationBuilder)

Adds a StatusCodePages middleware with a default response handler that checks for responses with status codes between 400 and 599 that do not have a body.

UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions)

Adds a StatusCodePages middleware with the given options that checks for responses with status codes between 400 and 599 that do not have a body.

UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>)

Adds a StatusCodePages middleware to the pipeline with the specified alternate middleware pipeline to execute to generate the response body.

UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>)

Adds a StatusCodePages middleware with the specified handler that checks for responses with status codes between 400 and 599 that do not have a body.

UseStatusCodePages(IApplicationBuilder, String, String)

Adds a StatusCodePages middleware with the specified response body to send. This may include a '{0}' placeholder for the status code. The middleware checks for responses with status codes between 400 and 599 that do not have a body.

UseStatusCodePagesWithRedirects(IApplicationBuilder, String)

Adds a StatusCodePages middleware to the pipeline. Specifies that responses should be handled by redirecting with the given location URL template. This may include a '{0}' placeholder for the status code. URLs starting with '~' will have PathBase prepended, where any other URL will be used as is.

UseStatusCodePagesWithReExecute(IApplicationBuilder, String, String)

Adds a StatusCodePages middleware to the pipeline. Specifies that the response body should be generated by re-executing the request pipeline using an alternate path. This path may contain a '{0}' placeholder of the status code.

UseTwitterAuthentication(IApplicationBuilder)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseTwitterAuthentication(IApplicationBuilder, TwitterOptions)

Obsolete, see https://go.microsoft.com/fwlink/?linkid=845470

UseTwitterAuthentication(IApplicationBuilder, TwitterOptions)

Adds the TwitterMiddleware middleware to the specified IApplicationBuilder, which enables Twitter authentication capabilities.

Use(IApplicationBuilder, Func<HttpContext,Func<Task>,Task>)

Adds a middleware delegate defined in-line to the application's request pipeline.

UseMiddleware(IApplicationBuilder, Type, Object[])

Adds a middleware type to the application's request pipeline.

UseMiddleware<TMiddleware>(IApplicationBuilder, Object[])

Adds a middleware type to the application's request pipeline.

UsePathBase(IApplicationBuilder, PathString)

Adds a middleware that extracts the specified path base from request path and postpend it to the request path base.

UseWhen(IApplicationBuilder, Func<HttpContext,Boolean>, Action<IApplicationBuilder>)

Conditionally creates a branch in the request pipeline that is rejoined to the main pipeline.

UseWebpackDevMiddleware(IApplicationBuilder, WebpackDevMiddlewareOptions)

Enables Webpack dev middleware support. This hosts an instance of the Webpack compiler in memory in your application so that you can always serve up-to-date Webpack-built resources without having to run the compiler manually. Since the Webpack compiler instance is retained in memory, incremental compilation is vastly faster that re-running the compiler from scratch.

Incoming requests that match Webpack-built files will be handled by returning the Webpack compiler output directly, regardless of files on disk. If compilation is in progress when the request arrives, the response will pause until updated compiler output is ready.

UseWebSockets(IApplicationBuilder)
UseWebSockets(IApplicationBuilder, WebSocketOptions)
UseWelcomePage(IApplicationBuilder)

Adds the WelcomePageMiddleware to the pipeline.

UseWelcomePage(IApplicationBuilder, WelcomePageOptions)

Adds the WelcomePageMiddleware to the pipeline with the given options.

UseWelcomePage(IApplicationBuilder, PathString)

Adds the WelcomePageMiddleware to the pipeline with the given path.

UseWelcomePage(IApplicationBuilder, String)

Adds the WelcomePageMiddleware to the pipeline with the given path.

Applies to