Class BuilderBase<TEndpoint>
- Namespace
- TypedRest.CodeGeneration.CSharp.Endpoints
- Assembly
- TypedRest.CodeGeneration.CSharp.dll
Common base class for IBuilder<TEndpoint>s.
public abstract class BuilderBase<TEndpoint> : IBuilder<TEndpoint>, IBuilder where TEndpoint : IEndpoint
Type Parameters
TEndpointThe type of IEndpoint to generate code for.
- Inheritance
-
objectBuilderBase<TEndpoint>
- Implements
-
IBuilder<TEndpoint>
- Derived
Methods
AddInterfaceAdapters(CSharpClass, CSharpIdentifier)
Adds explicit interface implementations to a generated class for members that it inherits with concrete
endpoint types while interfaceType declares them with the corresponding interface types
(e.g. an indexer returning IFooEndpoint rather than FooEndpoint).
protected virtual void AddInterfaceAdapters(CSharpClass implementation, CSharpIdentifier interfaceType)
Parameters
implementationCSharpClassThe generated class to add the members to.
interfaceTypeCSharpIdentifierThe endpoint interface the generated interface derives from.
Build(string, IEndpoint, IEndpointGenerator)
public (CSharpProperty property, IEnumerable<ICSharpType> types) Build(string key, IEndpoint endpoint, IEndpointGenerator generator)
Parameters
keystringendpointIEndpointgeneratorIEndpointGenerator
Returns
Build(string, TEndpoint, IEndpointGenerator)
public (CSharpProperty property, IEnumerable<ICSharpType> types) Build(string key, TEndpoint endpoint, IEndpointGenerator generator)
Parameters
keystringendpointTEndpointgeneratorIEndpointGenerator
Returns
GetAdditional(string, TEndpoint, IEndpointGenerator)
protected virtual (IEnumerable<ICSharpType> types, IEnumerable<CSharpIdentifier> typeArguments) GetAdditional(string key, TEndpoint endpoint, IEndpointGenerator generator)
Parameters
keystringendpointTEndpointgeneratorIEndpointGenerator
Returns
GetImplementationType(TEndpoint, INamingStrategy)
protected abstract CSharpIdentifier GetImplementationType(TEndpoint endpoint, INamingStrategy naming)
Parameters
endpointTEndpointnamingINamingStrategy
Returns
GetInterfaceType(CSharpIdentifier, bool)
protected virtual CSharpIdentifier GetInterfaceType(CSharpIdentifier implementationType, bool withInterfaces)
Parameters
implementationTypeCSharpIdentifierwithInterfacesbool
Returns
GetParameters(TEndpoint, IEndpointGenerator)
protected virtual IEnumerable<CSharpParameter> GetParameters(TEndpoint endpoint, IEndpointGenerator generator)
Parameters
endpointTEndpointgeneratorIEndpointGenerator