Class EntryBuilder
- Namespace
- TypedRest.CodeGeneration.TypeScript.Endpoints
- Assembly
- TypedRest.CodeGeneration.TypeScript.dll
Builds TypeScript code for EntryEndpoints.
public class EntryBuilder : BuilderBase<EntryEndpoint>, IBuilder<EntryEndpoint>, IBuilder
- Inheritance
-
objectEntryBuilder
- Implements
- Inherited Members
Methods
BuildConstructor(EntryEndpoint, List<TsExpression>, IEndpointGenerator)
Builds the constructor of a generated endpoint class, or null to inherit the base constructor.
protected override TsConstructor? BuildConstructor(EntryEndpoint endpoint, List<TsExpression> extraArguments, IEndpointGenerator generator)
Parameters
endpointEntryEndpointextraArgumentsList<TsExpression>generatorIEndpointGenerator
Returns
Remarks
An endpoint that knows its own relative URI bakes it into the super() call and drops the parameter.
An endpoint in an element position does not know its URI - it is handed one per element by the collection
or indexer that owns it - so it must keep forwarding the parameter. Hard-coding a URI there would still
compile, because TypeScript accepts a constructor with fewer parameters where one with more is expected,
but every element would silently resolve to the same URI at runtime.
GetBaseType(EntryEndpoint, IEndpointGenerator)
Returns the TypedRest type the endpoint derives from.
protected override TsIdentifier GetBaseType(EntryEndpoint endpoint, IEndpointGenerator generator)
Parameters
endpointEntryEndpointgeneratorIEndpointGenerator