entity

Creates C# domain entities, enums, DbSets, and UnitOfWork registrations for backend microservices.

1|Updated Apr 27, 2026
One-click install
npx skills add https://github.com/GSU26SE55/backend --skill entity-gsu26se55
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: entity
Source: https://github.com/GSU26SE55/backend/tree/main/.codex/skills/be/entity
Command: npx skills add https://github.com/GSU26SE55/backend --skill entity-gsu26se55

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a new domain entity to a layered .NET microservice touches many files — the entity class, its status enum, the DbContext, and the UnitOfWork interface and implementation — and any inconsistency breaks the architecture conventions. This Skill enforces the exact patterns so every entity is created correctly the first time. ## Core Features & Use Cases - Entity Scaffolding: Generates entity classes extending AuditableEntity with Guid primary keys, nullable foreign keys, and initialized navigation collections. - Enum Conventions: Creates status enums with values starting from 1, placed in Domain/Enums following the {Entity}StatusEnum naming rule. - Persistence Wiring: Adds the DbSet to ApplicationDbContext and registers the repository in both the IUnitOfWork interface and its UnitOfWork implementation. - Use Case: When adding a new Battery entity to BatteryService, the Skill produces the entity, BatteryStatusEnum, the Batteries DbSet, and the lazy-initialized GenericRepository property in UnitOfWork — all in the correct file locations. ## Quick Start Ask the AI to create a new entity named Battery with a status enum and wire it into the DbContext and UnitOfWork for the service.

Frequently Asked Questions about entity

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

FAQPage Schema
How do I add a new entity to a .NET microservice with clean architecture?▼

Create the entity class in Domain/Entities extending AuditableEntity, add a status enum in Domain/Enums, register a DbSet in ApplicationDbContext, and expose an IGenericRepository property through the UnitOfWork interface and implementation.

How to create a status enum for a C# domain entity?▼

Define the enum in Domain/Enums named {Entity}StatusEnum with explicit integer values starting from 1, never 0. Reference it as a property on the entity with a sensible default value.

Should entity primary keys be Guid or int in Entity Framework Core?▼

This pattern uses Guid primary keys inherited from AuditableEntity, which also provides CreatedAt, CreatedBy, UpdatedAt, IsDeleted, and DeletedAt audit fields. Integer auto-increment keys are not used.

How do I register a new repository in a UnitOfWork pattern?▼

Add an IGenericRepository<T> property to the service's IUnitOfWork interface, then implement it in UnitOfWork.cs using a private backing field with lazy initialization: _batteries ??= new GenericRepository<Battery>(_context).

Can the domain layer reference infrastructure or application layers?▼

No. The domain layer must have zero dependencies on other layers. Entities, enums, and domain logic stay isolated so infrastructure concerns like EF Core never leak into the domain model.