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
appArcApplicationThe ArcApplication to map the endpoint to.
patternstringThe route pattern.
handlerFunc<IHttpRequestContext, Task>The handler for the request.
metadataEndpointMetadataOptional 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
appArcApplicationThe ArcApplication to map the endpoint to.
patternstringThe route pattern.
handlerFunc<IHttpRequestContext, Task>The handler for the request.
metadataEndpointMetadataOptional metadata for the endpoint (tags, name, etc.).
Returns
- ArcApplication
The ArcApplication for chaining.