Project Setup Generators

These generators produce the foundational project files needed for the generated API to compile and run.

ProgramGenerator

| Scope | Single File | |—|—|

Generates the Program.cs entry point for the web API application. Includes AddNinjadog() and UseNinjadog() calls to wire up all generated services, endpoints, and middleware.

The generated Program.cs includes:

IndexPageGenerator

| Scope | Single File | |—|—|

Generates a wwwroot/index.html landing page for the API. The page displays:

The generated API serves this page at the root URL (/) using ASP.NET Core static file middleware (UseDefaultFiles + UseStaticFiles), so navigating to http://localhost:5000/ shows the landing page instead of a blank 404.

RequestCorrelationMiddlewareGenerator

| Scope | Single File | |—|—|

Generates a Middleware/RequestCorrelationMiddleware.cs that:

AppSettingsGenerator

| Scope | Single File | |—|—|

Generates the appsettings.json configuration file with default settings for the application, including the SQLite connection string and Serilog structured logging configuration.

The Serilog configuration includes:

DomainEntityGenerator

| Scope | Per Entity | |—|—|

Generates the domain entity class for each entity defined in ninjadog.json. Each domain entity contains all properties from the configuration as a plain C# class.