Table of Contents

Class BuilderRegistry<TBuilder>

Namespace
TypedRest.CodeGeneration.Generation
Assembly
TypedRest.CodeGeneration.dll

Maps each Kind to the builder emitting code for it, holding at most one builder per kind.

public class BuilderRegistry<TBuilder> where TBuilder : notnull

Type Parameters

TBuilder

The target language's builder interface.

Inheritance
object
BuilderRegistry<TBuilder>
Derived

Methods

For(IEndpoint)

Returns the builder suitable for the kind of endpoint.

public TBuilder For(IEndpoint endpoint)

Parameters

endpoint IEndpoint

Returns

TBuilder

Exceptions

KeyNotFoundException

No builder matching the endpoint's kind found.

Register<TEndpoint>(TBuilder)

Registers builder for the kind of TEndpoint.

protected void Register<TEndpoint>(TBuilder builder) where TEndpoint : IEndpoint, new()

Parameters

builder TBuilder

Type Parameters

TEndpoint

The type of IEndpoint the builder generates code for.

Remarks

Deliberately not called Add, so that a derived fluent Add taking a more specific builder type cannot accidentally bind to itself.

Exceptions

ArgumentException

A builder is already registered for that kind.