Table of Contents

Class CollectionBuilderBase<TEndpoint>

Namespace
TypedRest.CodeGeneration.TypeScript.Endpoints
Assembly
TypedRest.CodeGeneration.TypeScript.dll

Common base class for IBuilder<TEndpoint>s for CollectionEndpoint and derived types.

public abstract class CollectionBuilderBase<TEndpoint> : BuilderBase<TEndpoint>, IBuilder<TEndpoint>, IBuilder where TEndpoint : CollectionEndpoint

Type Parameters

TEndpoint

The type of CollectionEndpoint to generate code for.

Inheritance
object
BuilderBase<TEndpoint>
CollectionBuilderBase<TEndpoint>
Implements
IBuilder<TEndpoint>
Derived
Inherited Members

Properties

GenericTypeName

The name of the TypedRest type taking the element endpoint class as a constructor argument, e.g. GenericCollectionEndpoint.

protected abstract string GenericTypeName { get; }

Property Value

string

TypeName

The name of the TypedRest type creating its element endpoints itself, e.g. CollectionEndpoint.

protected abstract string TypeName { get; }

Property Value

string

Methods

GetBase(string, TEndpoint, IEndpointGenerator)

Returns the TypedRest type the endpoint derives from, any additional types generated along the way, and any constructor arguments beyond the referrer and the relative URI.

protected override (TsIdentifier baseType, IEnumerable<ITsType> types, IEnumerable<TsExpression> extraArguments) GetBase(string key, TEndpoint endpoint, IEndpointGenerator generator)

Parameters

key string
endpoint TEndpoint
generator IEndpointGenerator

Returns

(TsIdentifier baseType, IEnumerable<ITsType> types, IEnumerable<TsExpression> extraArguments)

Remarks

TypeScript splits the two arities of the C# CollectionEndpoint into two classes: CollectionEndpoint<TEntity>, which creates plain element endpoints itself, and GenericCollectionEndpoint<TEntity, TElementEndpoint>, which takes the element endpoint class as a constructor argument.

GetBaseType(TEndpoint, IEndpointGenerator)

Returns the TypedRest type the endpoint derives from.

protected override TsIdentifier GetBaseType(TEndpoint endpoint, IEndpointGenerator generator)

Parameters

endpoint TEndpoint
generator IEndpointGenerator

Returns

TsIdentifier