Microsoft.AspNetCore

Provides core types for building ASP.NET Core applications. This namespace contains fundamental building blocks like middleware, request/response handling, and endpoint routing.

HttpContext Class

Represents the HTTP context, which contains information about both the individual HTTP operation and any other associated data.

Properties

  • Request: HttpRequest The object representing the HTTP request.
  • Response: HttpResponse The object representing the HTTP response.
  • Items: IDictionary<object, object> Gets or sets a dictionary for passing arbitrary data between middleware.
  • Connection: IFeatureCollection Gets the collection of HTTP features available on this connection.

Methods

  • Abort() Aborts the connection.
public abstract class HttpContext

IApplicationBuilder Interface

Provides programming model for configuring an application's request pipeline.

Properties

  • ApplicationServices: IServiceProvider Gets or sets the application's service provider.
  • ServerFeatures: IFeatureCollection Gets the collection of server-specific features.

Methods

  • Use(Func<RequestDelegate, RequestDelegate> middleware) Adds a middleware delegate to the application's request pipeline.
  • Build(): RequestDelegate Builds the request pipeline and returns a delegate that can be executed.
public interface IApplicationBuilder

RequestDelegate Delegate

Represents a delegate that may be invoked to process an HTTP request.

Signature

  • Task Invoke(HttpContext context)
public delegate Task RequestDelegate(HttpContext context);

Microsoft.AspNetCore.Http.Features Namespace

Contains types related to HTTP features and feature collections.