Domain Original Names Prompts
Standalone prompt for applying
[Table]and[Column]EF Core annotations to domain models. Use this when the user wants to map FlexBase domain models back to their original database table and column names — enabling EF Core migrations to generate the correct schema.This is separate from the main implementation completion workflow — it can be run independently on any FlexBase domain model project that has extraction JSON with
originalName/sourceTablemetadata.
When to Use
Legacy migrations — keeping the original database schema so existing data doesn't require restructuring
Brownfield projects — new FlexBase API layer on top of an existing database
Database-first scenarios — FlexBase domain models must match an existing schema exactly
Post-implementation — can be applied at any time after domain models are generated
How to Use
Copy-paste any prompt below into your AI agent chat:
Apply all original names:
Apply original database names to the domain modelsExplicit Table/Column request:
Add [Table] and [Column] attributes from the extraction JSONLegacy schema mapping:
Map domain models to their legacy database schemaEF Core annotation shorthand:
What It Does
The agent reads the extraction JSON (*_DomainServices.json) and applies:
[Table("name", Schema = "schema")]to each domain model class based onmetadata.sourceTable[Column("originalName")]to each property where the original column name differs from the property nameFK type fixes — ensures all foreign key properties are
stringtype (not int/Guid)C# keyword handling — properties renamed to avoid C# keywords get
[Column]to preserve the original nameBuild verification — 0 errors after all annotations applied
Prerequisites: Domain model .cs files must exist (generated by FlexBase Studio) and extraction JSON must contain originalName / sourceTable metadata.
Related
Full implementation completion: Implementation Completion
Legacy migration extraction: Legacy Migration → Markdown
Last updated