ERD to C# Entity Generator
Turn your PlantUML ERD diagrams into clean, EF Core-ready C# entity classes — in one click.
What It Does
- Reads a PlantUML ERD diagram (
.puml / .plantuml file)
- Generates one C# class per entity in the diagram
- Detects primary keys and foreign keys automatically
- Maps PlantUML column types to C# types (
varchar → string, int → int, datetime → DateTime)
- Adds navigation properties for relationships
- Generates a shared
BaseEntity.cs with audit fields
- Resolves the namespace from your
.csproj automatically
- Never overwrites your work without asking (Skip / Overwrite / Rename / Cancel)
Quick Start
- Open a PlantUML ERD file (
.puml) in VS Code
- Right-click the file (or press
Ctrl+Shift+P → ERD: Generate C# Entities)
- Done — entity files appear in an
Entity/ folder next to your diagram
That's it. No configuration needed for the first run.
Type Mapping
| PlantUML |
C# |
varchar, char, text, nvarchar, nchar, ntext, json, jsonb |
string |
int, integer, serial |
int |
bigint, bigserial, long |
long |
smallint |
short |
tinyint |
byte |
decimal, numeric, number, money |
decimal |
float / double, real |
float / double |
bool, boolean |
bool |
uuid, uniqueidentifier |
Guid |
blob, binary, varbinary, bytea |
byte[] |
date |
DateOnly |
datetime, datetime2, timestamp |
DateTime |
datetimeoffset, timestamptz |
DateTimeOffset |
time |
TimeOnly |
How the Namespace Is Chosen
.csproj nearby — the extension walks up from your diagram's folder looking for a .csproj. Uses its <RootNamespace> (or project name) + .Entity. Example: MyCompany.Api → namespace MyCompany.Api.Entity;
- No project found — falls back to the workspace folder name +
.Entity
- No workspace —
MyProject.Entity
Requirements
- Visual Studio Code 1.85.0 or later
Release Notes
1.1.0
Added support for 18 additional data types: long, numeric, number, serial, bigserial, money, real, nvarchar, nchar, ntext, blob, binary, varbinary, bytea, timestamp, timestamptz, uniqueidentifier, json, jsonb.
1.0.0
Initial release: PlantUML ERD parsing, C# entity generation, EF Core-ready navigation properties, base entity, and namespace resolution.
License
MIT
| |