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 / sourceTable metadata.

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 models

Explicit Table/Column request:

Add [Table] and [Column] attributes from the extraction JSON

Legacy schema mapping:

Map domain models to their legacy database schema

EF Core annotation shorthand:


What It Does

The agent reads the extraction JSON (*_DomainServices.json) and applies:

  1. [Table("name", Schema = "schema")] to each domain model class based on metadata.sourceTable

  2. [Column("originalName")] to each property where the original column name differs from the property name

  3. FK type fixes — ensures all foreign key properties are string type (not int/Guid)

  4. C# keyword handling — properties renamed to avoid C# keywords get [Column] to preserve the original name

  5. Build 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.


Last updated