party-tph-catalog

Manage polymorphic catalog dimensions with TPH inheritance and Entity Framework Core.

1|Updated Feb 28, 2024
One-click install
npx skills add https://github.com/Sparkymod/Template --skill party-tph-catalog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: party-tph-catalog
Source: https://github.com/Sparkymod/Template/tree/main/.claude/skills/party-tph-catalog
Command: npx skills add https://github.com/Sparkymod/Template --skill party-tph-catalog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps manage small, polymorphic catalog dimensions with a single table, reducing the need for full entity scaffolding and streamlining the process.

Core Features & Use Cases

  • Single Table Management: Centralizes common fields like audit, state, and soft delete for multiple catalog dimensions.
  • Inheritance and Discrimination: Utilizes TPH (Table Per Hierarchy) inheritance with a discriminator string for shared table structure.
  • DTO and Service Inheritance: Simplifies DTO and service implementations by inheriting from base classes.
  • CRUD and Permissions: Implements CRUD operations and permissions without additional join tables.

Quick Start

Implement a new catalog dimension using the party-tph-catalog skill with the following command: 'use party-tph-catalog to create a new tag entity'.

Frequently Asked Questions about party-tph-catalog

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

FAQPage Schema
How do I manage multiple polymorphic catalog dimensions in Entity Framework Core without creating separate tables?

TPH inheritance allows you to manage polymorphic catalog dimensions using a single database table with a discriminator string. This centralizes shared fields like audit trails and soft deletes, eliminating the need for full entity scaffolding for each small catalog.

What is TPH inheritance and when should I use it for catalog management?

TPH (Table Per Hierarchy) is an Entity Framework Core mapping strategy that uses a discriminator column to differentiate entity types in a single table. Use it for small catalog dimensions to share audit fields, state, and CRUD logic without requiring extra join tables.

Does this TPH catalog management approach support permissions and CRUD operations without join tables?

Yes, this TPH catalog management approach implements CRUD operations and permissions directly without requiring additional join tables. By inheriting DTOs and services from base classes, it handles shared state and access rules within the single-table structure.

What's the best way to create a new polymorphic catalog entity using TPH inheritance?

The best way to create a new polymorphic catalog entity is to inherit from the base TPH classes for entities, DTOs, and services. You then register the new entity with a specific discriminator string in Entity Framework Core to activate its CRUD operations and shared state management.

Do I need Entity Framework Core to use TPH inheritance for catalog dimensions?

Yes, Entity Framework Core is required because it handles the table operations and discriminator registration essential for TPH inheritance. The framework manages the single-table mapping and shared state logic that streamline polymorphic catalog dimensions.