Class EndpointMappingExtensions

Namespace
Cratis.Arc
Assembly
Cratis.Arc.Core.dll

Provides extension methods for mapping HTTP endpoints to an ArcApplication.

public static class EndpointMappingExtensions
Inheritance
EndpointMappingExtensions
Inherited Members

Methods

MapGet(ArcApplication, string, Func<IHttpRequestContext, Task>, EndpointMetadata?)

Maps a GET endpoint.

public static ArcApplication MapGet(this ArcApplication app, string pattern, Func<IHttpRequestContext, Task> handler, EndpointMetadata? metadata = null)

Parameters

app ArcApplication

The ArcApplication to map the endpoint to.

pattern string

The route pattern.

handler Func<IHttpRequestContext, Task>

The handler for the request.

metadata EndpointMetadata

Optional metadata for the endpoint (tags, name, etc.).

Returns

ArcApplication

The ArcApplication for chaining.

MapPost(ArcApplication, string, Func<IHttpRequestContext, Task>, EndpointMetadata?)

Maps a POST endpoint.

public static ArcApplication MapPost(this ArcApplication app, string pattern, Func<IHttpRequestContext, Task> handler, EndpointMetadata? metadata = null)

Parameters

app ArcApplication

The ArcApplication to map the endpoint to.

pattern string

The route pattern.

handler Func<IHttpRequestContext, Task>

The handler for the request.

metadata EndpointMetadata

Optional metadata for the endpoint (tags, name, etc.).

Returns

ArcApplication

The ArcApplication for chaining.