Appearance
Carrot.Data.Scaffold.Compilers.Modules.NetClient
net
Scaffold compiler module intended to generate a .NET client library for API consumption. Currently an empty placeholder.
Installation
xml
<ProjectReference Include="..\Carrot.Data.Scaffold.Compilers.Modules.NetClient\Carrot.Data.Scaffold.Compilers.Modules.NetClient.csproj" />Architecture
Not yet implemented. Based on the project structure and the pattern established by the other scaffold compiler modules, this module will likely:
- Extend
ScaffoldCompilerModule<ScaffoldApi, ScaffoldCompilerNetClientOptions> - Iterate the
ScaffoldApigraph (controllers, models, commands, types, enums) - Generate typed .NET HTTP client classes mirroring the API surface
- Follow the same renderer pattern as
TypescriptClientbut targeting C# output
The project already references Carrot.Data.Scaffold.Compilers and has an empty Data/Scaffold/Graph/ folder ready for graph extensions.
Dependencies
| Dependency | Kind |
|---|---|
Carrot.Data.Scaffold.Compilers | project (scaffold compiler framework) |
Build
bash
dotnet buildTargets net10.0.
Usage Guide
This module is intended to generate a .NET client library for consuming Carrot APIs from other .NET services. It is currently an empty placeholder with no implemented functionality.
Getting Started
Not yet available. When implemented, registration will follow the standard pattern:
csharp
IScaffoldCompiler compiler = scaffold.CreateCompiler()
.AddModuleNetClient();Expected Patterns
Based on the TypescriptClient module (the closest parallel), this module will likely generate:
- Typed HTTP client classes per API controller
- Request/response model classes matching the API surface
- Strongly-typed endpoint methods with parameter binding
- Serialization/deserialization for all API types, enums, commands, and models
Tips
- Use the TypescriptClient module as reference if contributing to this module - it follows the same scaffold graph iteration pattern and renderer structure that NetClient will need.
- For now, use
HttpClientdirectly or a hand-written client when calling Carrot APIs from .NET services.