Interface IEndpointGenerator
- Namespace
- TypedRest.CodeGeneration.CSharp.Endpoints
- Assembly
- TypedRest.CodeGeneration.CSharp.dll
public interface IEndpointGenerator
Properties
GenerateEntryConstructor
Controls whether the entry endpoint gets a generated constructor taking the base URI. Turn this off to supply the constructors yourself in a partial class, e.g. to pass an error handler or custom headers.
bool GenerateEntryConstructor { get; }
Property Value
Naming
INamingStrategy Naming { get; }
Property Value
WithInterfaces
bool WithInterfaces { get; }
Property Value
Methods
EndpointType(string, IEndpoint)
Returns the name to use for the class generated for an endpoint with the given key.
Endpoints that share a key are disambiguated with a prefix derived from their parents, or failing that a number.
CSharpIdentifier EndpointType(string key, IEndpoint endpoint)
Parameters
Returns
Remarks
Every call hands out a new name, so this must be called exactly once per generated class.
Generate(string, IEndpoint)
(CSharpProperty property, IEnumerable<ICSharpType> types) Generate(string key, IEndpoint endpoint)
Parameters
Returns
PopParent()
Pops a key from the parent stack.
void PopParent()
PushParent(string)
Pushes a key onto the parent stack. Builders call this around recursion into child endpoints so that EndpointType(string, IEndpoint) can derive prefixes from the current parents.
void PushParent(string key)
Parameters
keystring