Share via


MapRouteRouteBuilderExtensions.MapRoute Method

Definition

Overloads

MapRoute(IRouteBuilder, String, String)

Adds a route to the IRouteBuilder with the specified name and template.

MapRoute(IRouteBuilder, String, String, Object)

Adds a route to the IRouteBuilder with the specified name, template, and default values.

MapRoute(IRouteBuilder, String, String, Object, Object)

Adds a route to the IRouteBuilder with the specified name, template, default values, and constraints.

MapRoute(IRouteBuilder, String, String, Object, Object, Object)

Adds a route to the IRouteBuilder with the specified name, template, default values, and data tokens.

MapRoute(IRouteBuilder, String, String)

Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs

Adds a route to the IRouteBuilder with the specified name and template.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String) As IRouteBuilder

Parameters

routeBuilder
IRouteBuilder

The IRouteBuilder to add the route to.

name
String

The name of the route.

template
String

The URL pattern of the route.

Returns

A reference to this instance after the operation has completed.

Applies to

MapRoute(IRouteBuilder, String, String, Object)

Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs

Adds a route to the IRouteBuilder with the specified name, template, and default values.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template, System::Object ^ defaults);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template, object defaults);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template, object? defaults);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string * obj -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String, defaults As Object) As IRouteBuilder

Parameters

routeBuilder
IRouteBuilder

The IRouteBuilder to add the route to.

name
String

The name of the route.

template
String

The URL pattern of the route.

defaults
Object

An object that contains default values for route parameters. The object's properties represent the names and values of the default values.

Returns

A reference to this instance after the operation has completed.

Applies to

MapRoute(IRouteBuilder, String, String, Object, Object)

Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs

Adds a route to the IRouteBuilder with the specified name, template, default values, and constraints.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template, System::Object ^ defaults, System::Object ^ constraints);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template, object defaults, object constraints);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template, object? defaults, object? constraints);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string * obj * obj -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String, defaults As Object, constraints As Object) As IRouteBuilder

Parameters

routeBuilder
IRouteBuilder

The IRouteBuilder to add the route to.

name
String

The name of the route.

template
String

The URL pattern of the route.

defaults
Object

An object that contains default values for route parameters. The object's properties represent the names and values of the default values.

constraints
Object

An object that contains constraints for the route. The object's properties represent the names and values of the constraints.

Returns

A reference to this instance after the operation has completed.

Applies to

MapRoute(IRouteBuilder, String, String, Object, Object, Object)

Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs
Source:
MapRouteRouteBuilderExtensions.cs

Adds a route to the IRouteBuilder with the specified name, template, default values, and data tokens.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Routing::IRouteBuilder ^ MapRoute(Microsoft::AspNetCore::Routing::IRouteBuilder ^ routeBuilder, System::String ^ name, System::String ^ template, System::Object ^ defaults, System::Object ^ constraints, System::Object ^ dataTokens);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string name, string template, object defaults, object constraints, object dataTokens);
public static Microsoft.AspNetCore.Routing.IRouteBuilder MapRoute (this Microsoft.AspNetCore.Routing.IRouteBuilder routeBuilder, string? name, string? template, object? defaults, object? constraints, object? dataTokens);
static member MapRoute : Microsoft.AspNetCore.Routing.IRouteBuilder * string * string * obj * obj * obj -> Microsoft.AspNetCore.Routing.IRouteBuilder
<Extension()>
Public Function MapRoute (routeBuilder As IRouteBuilder, name As String, template As String, defaults As Object, constraints As Object, dataTokens As Object) As IRouteBuilder

Parameters

routeBuilder
IRouteBuilder

The IRouteBuilder to add the route to.

name
String

The name of the route.

template
String

The URL pattern of the route.

defaults
Object

An object that contains default values for route parameters. The object's properties represent the names and values of the default values.

constraints
Object

An object that contains constraints for the route. The object's properties represent the names and values of the constraints.

dataTokens
Object

An object that contains data tokens for the route. The object's properties represent the names and values of the data tokens.

Returns

A reference to this instance after the operation has completed.

Applies to