Table of Contents

Class EndpointGenerator

Namespace
TypedRest.CodeGeneration.CSharp.Endpoints
Assembly
TypedRest.CodeGeneration.CSharp.dll
public class EndpointGenerator : IEndpointGenerator
Inheritance
object
EndpointGenerator
Implements

Constructors

EndpointGenerator(INamingStrategy, BuilderRegistry)

public EndpointGenerator(INamingStrategy namingStrategy, BuilderRegistry builders)

Parameters

namingStrategy INamingStrategy
builders BuilderRegistry

Properties

Naming

public INamingStrategy Naming { get; }

Property Value

INamingStrategy

WithInterfaces

public bool WithInterfaces { get; set; }

Property Value

bool

Methods

Generate(string, IEndpoint)

public (CSharpProperty property, IEnumerable<ICSharpType> types) Generate(string key, IEndpoint endpoint)

Parameters

key string
endpoint IEndpoint

Returns

(CSharpProperty property, IEnumerable<ICSharpType> types)

Generate(EntryEndpoint)

public IEnumerable<ICSharpType> Generate(EntryEndpoint endpoint)

Parameters

endpoint EntryEndpoint

Returns

IEnumerable<ICSharpType>

GetCollisionPrefix(string)

Returns a disambiguating prefix for an endpoint with the given key, or null if no prefix is needed. Currently returns the parent key when the same key produces a custom endpoint class in more than one place.

public string? GetCollisionPrefix(string key)

Parameters

key string

Returns

string

PopParent()

Pops a key from the parent stack.

public void PopParent()

PushParent(string)

Pushes a key onto the parent stack. Builders call this around recursion into child endpoints so that GetCollisionPrefix(string) can return the current parent.

public void PushParent(string key)

Parameters

key string