Class RDWebEndpointRouteBuilderExtensions
- Namespace
- RDCore.Web.Hosting
- Assembly
- RDCore.Web.dll
Maps the endpoints of an RD-VBA application into ASP.NET Core routing.
public static class RDWebEndpointRouteBuilderExtensions
- Inheritance
-
RDWebEndpointRouteBuilderExtensions
- Inherited Members
Methods
MapRDWebEndpoints(IEndpointRouteBuilder, IEnumerable<RDWebEndpoint>, RDWebMachinePool)
Maps each endpoint to its route and HTTP method, served by the procedure that declares it.
public static IEndpointConventionBuilder MapRDWebEndpoints(this IEndpointRouteBuilder routes, IEnumerable<RDWebEndpoint> endpoints, RDWebMachinePool pool)
Parameters
routesIEndpointRouteBuilderThe application's routes.
endpointsIEnumerable<RDWebEndpoint>The endpoints the application's controller modules declare.
poolRDWebMachinePoolThe machines that run the procedures.
Returns
- IEndpointConventionBuilder
A builder of the conventions of every endpoint mapped, such as an authorization policy.
Remarks
- A route parameter binds to the procedure's parameter of that name, as a string; a query string value binds to a parameter the route does not bind, by its name. The request's JSON body binds to BodyParameter.
- A value the procedure returns is the response's JSON body (
200); a procedure that returns none answers204. - A run-time error the procedure does not handle answers
500with a problem details body (RFC 9457) whoseerrorNumberis the error's number and whoseerrorCodeis its diagnostic code. A request the pool refuses, because no machine was idle in time or the machine refused it, answers503with aRetry-Afterof one second; any other outcome answers500. - A body that is not valid JSON answers
400, and one that is not of the JSON media type answers415, before the procedure runs.
Exceptions
- ArgumentException
An endpoint keeps a machine for each key (KeptMachineKey).
MapRDWebEndpoints(IEndpointRouteBuilder, IEnumerable<RDWebEndpoint>, RDWebMachinePool, RDWebKeptMachines?)
Maps each endpoint to its route and HTTP method, served by the procedure that declares it: on a machine of the pool, or on the kept machine of its
key for an endpoint of a controller that has '@KeptMachine.
public static IEndpointConventionBuilder MapRDWebEndpoints(this IEndpointRouteBuilder routes, IEnumerable<RDWebEndpoint> endpoints, RDWebMachinePool pool, RDWebKeptMachines? keptMachines)
Parameters
routesIEndpointRouteBuilderThe application's routes.
endpointsIEnumerable<RDWebEndpoint>The endpoints the application's controller modules declare.
poolRDWebMachinePoolThe machines that run the procedures of the endpoints that keep none.
keptMachinesRDWebKeptMachinesThe machines kept for the keys of the endpoints that keep them; null when no endpoint does.
Returns
- IEndpointConventionBuilder
A builder of the conventions of every endpoint mapped, such as an authorization policy.
Remarks
A request to an endpoint that keeps machines is answered as a request to the pool is, and also:
404with a problem details body when its key has no machine, and the endpoint does not make one;409when the endpoint makes a machine ('@NewMachine), and its key has one already;503with aRetry-Afterof one second when it would make one more machine than MaxMachines;204when the procedure ends its machine with anEndstatement.
Exceptions
- ArgumentException
An endpoint keeps a machine for each key (KeptMachineKey), and
keptMachinesis null.