Table of Contents

Class RDWebEndpointReader

Namespace
RDCore.Web.Endpoints
Assembly
RDCore.Web.dll

Reads the endpoints a module declares from its annotations: '@Controller in its declarations section, or above the header of its block (Module Name, Class Name) for the module of a block of a file, with the '@KeptMachine that names its machines' key, and an HTTP method annotation (HttpMethodOf(string)) immediately above each public Sub or Function that serves one, with the '@FromBody that names its body parameter and the '@NewMachine that makes its key's machine.

public static class RDWebEndpointReader
Inheritance
RDWebEndpointReader
Inherited Members

Methods

Read(ModuleParseResult, string)

The endpoints a module declares.

public static ImmutableArray<RDWebEndpoint> Read(ModuleParseResult parse, string moduleName)

Parameters

parse ModuleParseResult

The module's parse; for a file that has blocks, the parse of the one module (ParseOf(Uri)).

moduleName string

The module's name.

Returns

ImmutableArray<RDWebEndpoint>

One endpoint for each HTTP method annotation of each public procedure, in the order they are written; none for a module that is not a controller. A Private or Friend procedure serves no endpoint. A parameter declared As RequestContext is the library's (ContextParameters).

Exceptions

RDWebEndpointException

An annotation declares an endpoint that cannot be served (FromAnnotation(string, string?, string, IReadOnlyList<string>, string, string?, string?, string?, bool, IReadOnlyList<string>?, bool)).

Read(IComposedProgram)

The endpoints every module of a program declares: the modules of its documents (Documents), each file's own module and the module of each of its blocks (ModuleUris), each named as RD-VBA names it (NameOf(Uri)).

public static ImmutableArray<RDWebEndpoint> Read(IComposedProgram program)

Parameters

program IComposedProgram

The program.

Returns

ImmutableArray<RDWebEndpoint>

The endpoints of each module (Read(ModuleParseResult, string)), in the order of the documents and of their modules.

Exceptions

RDWebEndpointException

An annotation declares an endpoint that cannot be served (FromAnnotation(string, string?, string, IReadOnlyList<string>, string, string?, string?, string?, bool, IReadOnlyList<string>?, bool)).