Table of Contents

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

routes IEndpointRouteBuilder

The application's routes.

endpoints IEnumerable<RDWebEndpoint>

The endpoints the application's controller modules declare.

pool RDWebMachinePool

The 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 answers 204.
  • A run-time error the procedure does not handle answers 500 with a problem details body (RFC 9457) whose errorNumber is the error's number and whose errorCode is its diagnostic code. A request the pool refuses, because no machine was idle in time or the machine refused it, answers 503 with a Retry-After of one second; any other outcome answers 500.
  • A body that is not valid JSON answers 400, and one that is not of the JSON media type answers 415, 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

routes IEndpointRouteBuilder

The application's routes.

endpoints IEnumerable<RDWebEndpoint>

The endpoints the application's controller modules declare.

pool RDWebMachinePool

The machines that run the procedures of the endpoints that keep none.

keptMachines RDWebKeptMachines

The 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:

  • 404 with a problem details body when its key has no machine, and the endpoint does not make one;
  • 409 when the endpoint makes a machine ('@NewMachine), and its key has one already;
  • 503 with a Retry-After of one second when it would make one more machine than MaxMachines;
  • 204 when the procedure ends its machine with an End statement.

Exceptions

ArgumentException

An endpoint keeps a machine for each key (KeptMachineKey), and keptMachines is null.