Skip to content

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:

  1. Extend ScaffoldCompilerModule<ScaffoldApi, ScaffoldCompilerNetClientOptions>
  2. Iterate the ScaffoldApi graph (controllers, models, commands, types, enums)
  3. Generate typed .NET HTTP client classes mirroring the API surface
  4. Follow the same renderer pattern as TypescriptClient but targeting C# output

The project already references Carrot.Data.Scaffold.Compilers and has an empty Data/Scaffold/Graph/ folder ready for graph extensions.

Dependencies

DependencyKind
Carrot.Data.Scaffold.Compilersproject (scaffold compiler framework)

Build

bash
dotnet build

Targets 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 HttpClient directly or a hand-written client when calling Carrot APIs from .NET services.

Carrot