Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

EndpointRouteBuilderExtensions.MapGet Method

Definition

Namespace:
Microsoft.AspNetCore.Builder
Assembly:
Microsoft.AspNetCore.Routing.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
MapGet(IEndpointRouteBuilder, String, Delegate)

Adds a RouteEndpoint to the IEndpointRouteBuilder that matches HTTP GET requests for the specified pattern.

MapGet(IEndpointRouteBuilder, String, RequestDelegate)

Adds a RouteEndpoint to the IEndpointRouteBuilder that matches HTTP GET requests for the specified pattern.

MapGet(IEndpointRouteBuilder, String, Delegate)

Source:
EndpointRouteBuilderExtensions.cs

Adds a RouteEndpoint to the IEndpointRouteBuilder that matches HTTP GET requests for the specified pattern.

public static Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, Delegate handler);
static member MapGet : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * Delegate -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder
<Extension()>
Public Function MapGet (endpoints As IEndpointRouteBuilder, pattern As String, handler As Delegate) As RouteHandlerBuilder

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

pattern
String

The route pattern.

handler
Delegate

The delegate executed when the endpoint is matched.

Returns

A RouteHandlerBuilder that can be used to further customize the endpoint.

Applies to

MapGet(IEndpointRouteBuilder, String, RequestDelegate)

Source:
EndpointRouteBuilderExtensions.cs

Adds a RouteEndpoint to the IEndpointRouteBuilder that matches HTTP GET requests for the specified pattern.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IEndpointConventionBuilder ^ MapGet(Microsoft::AspNetCore::Routing::IEndpointRouteBuilder ^ endpoints, System::String ^ pattern, Microsoft::AspNetCore::Http::RequestDelegate ^ requestDelegate);
public static Microsoft.AspNetCore.Builder.IEndpointConventionBuilder MapGet(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string pattern, Microsoft.AspNetCore.Http.RequestDelegate requestDelegate);
static member MapGet : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string * Microsoft.AspNetCore.Http.RequestDelegate -> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
<Extension()>
Public Function MapGet (endpoints As IEndpointRouteBuilder, pattern As String, requestDelegate As RequestDelegate) As IEndpointConventionBuilder

Parameters

endpoints
IEndpointRouteBuilder

The IEndpointRouteBuilder to add the route to.

pattern
String

The route pattern.

requestDelegate
RequestDelegate

The delegate executed when the endpoint is matched.

Returns

A IEndpointConventionBuilder that can be used to further customize the endpoint.

Applies to


Feedback

Was this page helpful?