Minimal API Endpoint Scaffolder

Describe an entity and its fields to generate ASP.NET Core Minimal API endpoint code — MapGroup, CRUD routes, DTOs, and a matching EF Core entity/DbSet snippet.

By Pankaj Kumar · DevToolsHub · Last updated Aug 2026

How to use this tool

  1. Enter an entity name (e.g. Product) and, optionally, a route prefix.
  2. Add each field as a name/type pair — string, int, decimal, bool, DateTime, Guid, and similar are all recognized as-is.
  3. Check which CRUD endpoints you want, and choose whether to use TypedResults and separate DTO records.
  4. Click Generate, then copy the endpoints code into your Program.cs and the entity/DbSet snippet into your model and DbContext.

What this tool generates

ASP.NET Core Minimal API endpoint code using MapGroup and route-group MapGet/MapPost/MapPut/MapDelete calls, an AppDbContext-shaped EF Core dependency injected directly into each handler, and a matching entity class with a DbSet<T> line to add to your context. It's template generation from the fields and options you provide — nothing is sent to an external API, and no Roslyn/compiler dependency is involved in producing it.

Worked example

Entity Product with fields Name:string and Price:decimal, all five CRUD endpoints, TypedResults on, DTO records on, generates (list + get-by-id shown):

var products = app.MapGroup("/api/products").WithTags("Products");

products.MapGet("/", async (AppDbContext db) =>
    TypedResults.Ok(await db.Products.ToListAsync()));

products.MapGet("/{id:int}", async Task<Results<Ok<Product>, NotFound>> (int id, AppDbContext db) =>
{
    var entity = await db.Products.FindAsync(id);
    return entity is not null ? TypedResults.Ok(entity) : TypedResults.NotFound();
});

TypedResults vs plain Results

TypedResults (the toggle's "on" state) uses the Results<TResult1, TResult2> union return type from Microsoft.AspNetCore.Http.HttpResults, with an explicit lambda return type annotation (async Task<Results<Ok<Product>, NotFound>> (...) => ...). This is fully statically typed — the compiler checks every possible response shape, and it's what OpenAPI/Swagger generation reads to document the endpoint's real response types. Plain Results (the toggle's "off" state) uses Results.Ok(...)/Results.NotFound() returning the untyped IResult interface — less ceremony, but OpenAPI metadata and the exact response shape aren't visible from the method signature alone.

What this tool can't do

It doesn't validate that your field types are real .NET types, doesn't generate EF Core migrations, and doesn't wire up dependency injection for AppDbContext itself — it assumes you already have an EF Core DbContext registered and named AppDbContext (rename it in the generated code if yours is named differently). The validation stubs on Create/Update are intentionally minimal — a real project should layer on FluentValidation, data annotations, or a validation library rather than relying on the generated string.IsNullOrWhiteSpace checks alone.

This tool is built with ASP.NET Core 8, Blazor Server, and pure string-template generation targeting ASP.NET Core 8 Minimal API and TypedResults shapes (no Roslyn/compiler dependency). It runs securely on Microsoft Azure.
Input Section
Leave blank to auto-derive from the entity name.

Fields

Endpoints to generate

Output Section

Enter an entity name and fields, then click Generate.