MapRouteOptions class

Options for mapping a route, including pattern, HTTP verbs, script code, authorization, and metadata.

public class MapRouteOptions

Public Members

name description
MapRouteOptions() The default constructor.
AllowAnonymous { get; set; } If true, allows anonymous access to this route.
CorsPolicy { get; set; } Name of the CORS policy to apply, if any.
DefaultResponseContentType { get; set; } Default response content type for this route.
DisableAntiforgery { get; set; } If true, disables antiforgery protection for this route.
DisableResponseCompression { get; set; } If true, disables response compression for this route.
Endpoints { get; set; } Endpoints to bind the route to, if any.
HttpVerbs { get; set; } The HTTP verbs (methods) that this route responds to.
OpenAPI { get; set; } OpenAPI metadata for this route.
PathLevelOpenAPIMetadata { get; set; } Path-level OpenAPI common metadata for this route.
Pattern { get; set; } The route pattern to match for this option.
RateLimitPolicyName { get; set; } The name of the rate limit policy to apply to this route, if any.
RequirePolicies { get; set; } Authorization policy names required for this route.
RequireSchemes { get; set; } Authorization Scheme names required for this route.
ScriptCode { get; set; } Script code and language options for this route.
ShortCircuit { get; set; } If true, short-circuits the pipeline after this route.
ShortCircuitStatusCode { get; set; } Status code to return if short-circuiting the pipeline after this route.
ThrowOnDuplicate { get; set; } If true, throws an exception on duplicate routes.
AddSecurityRequirementObject(…) Adds security requirement information to this route’s authorization settings.
override ToString() Returns a string representation of the MapRouteOptions.

See Also