A deterministic generator
Same model + same templates = same output, on every machine. Nothing in it needs an AI.
Model, template, code
You describe the domain in a small YAML model:
aggregate_roots:
book:
properties:
title:
field_size: 200
copies: int
status: $book_status
author: author
api:
query:
get:
add:
The whole syntax (types, relations, enums, value objects, services, API): YAML spec reference in the README.
A template is ordinary code with loop markers and placeholders. This one is part of the Mini set:
#region foreach MODEL[AG]
public partial class CLASSNAME
{
public _IDENTITY_KEY_TYPE_ Id { get; set; }
#region foreach PROPERTY[S][NO][NAR]
public _SIMPLE__TYPE_ _SIMPLE__PROPERTYNAME_ { get; set; } = _DEFAULT_VALUE_;
#endregion foreach PROPERTY
}
#endregion foreach MODEL
Burgr writes the files, named *.g.cs:
public partial class Book
{
public Guid Id { get; set; }
public System.String Title { get; set; } = string.Empty;
public System.Int32 Copies { get; set; } = default(System.Int32);
}
Extension points are partial members: you write them by hand, in files Burgr never touches.
Template sets
| Package | Generates |
|---|---|
Burgr.Templates.Mini (default) | One project: Minimal API, DTOs, EF Core DbContext, CRUD endpoints. No framework of its own. |
Burgr.Templates.Onion | Domain, Application, Infrastructure, Api and Tests projects, a class diagram, rights, rules, factories, events, paged queries, plus a light framework generated as *.f.cs. |
Template sets are NuGet packages tagged burgr-templates. Write your own for your architecture, in any language: templates are text. Samples: Mini, Onion.
When not to use it
- One-off code. Templates pay off when many entities share a shape. A single endpoint is faster by hand.
- Mostly business logic. Generated code covers the structural part (entities, DTOs, persistence, API). Hand-written logic costs the same either way.
- A shape that varies per entity. If every entity needs special-casing, the template becomes the thing you maintain.
- A stack no template set covers, when you do not want to write one.
Compared with
| Approach | Difference |
|---|---|
| OpenAPI generators | They start from an API contract; Burgr starts from the domain and can also produce persistence, schema and diagrams. |
| JHipster, Rails scaffolding | One fixed stack. Burgr has none: the template set is yours to choose or write. |
| Model-driven engineering | Same idea, with a deliberately small plain-text model and plain-text templates. |