coreex-refdata

Add or modify reference data types in CoreEx domains via database migrations and CodeGen.

28|8|Updated Feb 21, 2022
One-click install
npx skills add https://github.com/Avanade/CoreEx --skill coreex-refdata-avanade
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coreex-refdata
Source: https://github.com/Avanade/CoreEx/tree/main/.github/skills/coreex-refdata
Command: npx skills add https://github.com/Avanade/CoreEx --skill coreex-refdata-avanade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding a reference data (Code/Text lookup) type in a CoreEx solution touches two separate projects — the *.Database project for schema and seed rows, and the *.CodeGen project for entity definitions — and confusing the two YAML files or editing generated .g.cs files causes runtime failures. This Skill guides the complete end-to-end workflow so each step lands in the right place. ## Core Features & Use Cases - New reference data types: Scaffold the migration script, add seed rows, register the table in dbex.yaml, and generate contracts, controllers, services, repositories, and mappers via CodeGen. - Modify existing types: Add extra stored properties, amend seed rows, change pluralization or identifier types, and alter tables with immutable delta scripts. - Contract wiring: Attach an existing ref-data type to a contract using [ReferenceData<T>] partial properties with Roslyn-generated navigation accessors. - Use Case: You need a new Brand lookup table in a PostgreSQL-backed CoreEx service. The Skill walks you through creating the snake_case table script, seeding rows in ref-data.seed.yaml, defining the entity in ref-data.yaml, and running both dotnet run -- All and CodeGen in the correct order. ## Quick Start Ask the AI to add a new reference data type named Brand to your CoreEx domain with a few seed rows, and it will execute the database and CodeGen workflow end to end.

Frequently Asked Questions about coreex-refdata

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new reference data type in CoreEx?▼

Scaffold a migration with `dotnet run -- script refdata <schema> <table>` in the *.Database project, add seed rows to `Data/ref-data.seed.yaml`, register the table in `dbex.yaml`, run `dotnet run -- All`, then define the entity in the *.CodeGen project's `ref-data.yaml` and run `dotnet run`.

What is the difference between ref-data.yaml and ref-data.seed.yaml in CoreEx?▼

`ref-data.yaml` in the *.CodeGen project holds entity definitions (name, idType, properties), while `ref-data.seed.yaml` in the *.Database project holds seed rows. Mixing them up is the most common mistake and causes runtime failures.

Does CoreEx reference data support both SQL Server and PostgreSQL?▼

Yes. SQL Server uses PascalCase names and `.sql` scripts, while PostgreSQL uses snake_case names and `.pgsql` scripts. Check the *.Database project's `Program.cs` to confirm which provider is in use.

Can I edit the generated .g.cs files for a reference data type?▼

No. `.g.cs` files are owned by CodeGen and must never be hand-edited. Fix the `ref-data.yaml` definition and re-run `dotnet run` in the *.CodeGen project; only optional `partial` extension classes may be hand-authored.

When should I not use the coreex-refdata skill?▼

Do not use it for non-reference-data entity tables (use coreex-db-migration), for provisioning the transactional outbox, or for hand-authoring generated contract files. It is strictly for Code/Text lookup types and their seed data.