domain-entity-addition

Add persisted domain entities with EFCore configuration and repository contracts.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/SergeuMatyasov/dotnet-shared-skills --skill domain-entity-addition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: domain-entity-addition
Source: https://github.com/SergeuMatyasov/dotnet-shared-skills/tree/main/domain-entity-addition
Command: npx skills add https://github.com/SergeuMatyasov/dotnet-shared-skills --skill domain-entity-addition

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes the process of adding a new persisted domain entity into the main application context. It ensures the entity is placed in the correct domain layer, the naming is consistent, and the persistence wiring across Domain, IMainContext, and MainContext is properly configured. It also enforces creating the Domain repository contract, the EFCore implementation, and the necessary configuration so startup, migrations, and usage remain reliable.

Core Features & Use Cases

  • Domain placement: ensures the new entity resides in the Domain and is wired into the main context.
  • Repository contracts and EFCore wiring: creates I<Entity>Repository in Domain and <Entity>Repository in EFCore, with proper base classes and DI wiring.
  • Configuration and migrations: adds <Entity>Configuration and registers it in MainContext.OnModelCreating, plus generates a migration when the schema changes.

Quick Start

Create a new persisted domain entity following the established wiring rules and EFCore configuration.

Frequently Asked Questions about domain-entity-addition

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

FAQPage Schema
How do I add a new domain entity and wire it into EFCore correctly?

To add a new domain entity, place it in the domain layer and wire it into the main context by creating the repository contracts, EFCore configuration, and DI wiring. This ensures persistence, migrations, and startup remain reliable.

What's the best way to standardize domain entity creation across a main application context?

Standardize domain entity creation by enforcing consistent placement in the domain layer, generating repository contracts, and applying EFCore configuration within the main application context to maintain structural integrity across the codebase.

Do I need to manually register a new entity configuration in MainContext.OnModelCreating?

You need to register the new entity configuration in MainContext.OnModelCreating. Automating this step ensures the EFCore integration recognizes the schema changes and the application startup proceeds without configuration errors.

How do I generate a migration when adding a persisted domain entity?

Generate a migration after adding the persisted domain entity and its EFCore configuration. Applying this workflow ensures the schema changes are tracked and the database schema stays synchronized with the domain models.

Can I use this approach to create both the IMainContext and Domain repository contracts?

You can create both the IMainContext wiring and Domain repository contracts. The process ensures the I<Entity>Repository contract resides in the Domain layer while the EFCore implementation handles the persistence logic.