abp-entity-patterns

Generate ABP entity patterns, repositories, and domain services for .NET projects.

24|5|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill abp-entity-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: abp-entity-patterns
Source: https://github.com/thapaliyabikendra/ai-artifacts/tree/main/.claude/skills/abp-entity-patterns
Command: npx skills add https://github.com/thapaliyabikendra/ai-artifacts --skill abp-entity-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides you in building robust domain layers for ABP Framework applications, adhering to Domain-Driven Design (DDD) principles. It addresses challenges in entity design, repository implementation, and domain service creation, ensuring your business logic is encapsulated, testable, and maintainable.

Core Features & Use Cases

  • Entity Base Classes: Provides guidance on selecting the correct ABP base classes (FullAuditedAggregateRoot, IMultiTenant, ISoftDelete) for entities, ensuring proper auditing and tenancy.
  • Repository Pattern: Demonstrates how to use generic and custom repositories for efficient and clean data access, separating data concerns from business logic.
  • Domain Services: Explains when and how to create domain services for business logic involving multiple entities or external domain concepts, keeping entities focused on their own state.
  • Use Case: A backend developer is tasked with creating a new 'Patient' entity and its associated business rules. Using this skill, they design the Patient aggregate root, implement a custom IPatientRepository, and create an AppointmentManager domain service for complex scheduling logic.

Quick Start

Create a new ABP entity named 'Product' that inherits from FullAuditedAggregateRoot<Guid> and includes properties for Name and Price.

Frequently Asked Questions about abp-entity-patterns

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

FAQPage Schema
How do I design DDD entities for ABP Framework applications?

Design DDD entities by selecting appropriate ABP base classes like FullAuditedAggregateRoot for aggregate roots, applying IMultiTenant for multi-tenant support, and ISoftDelete for soft-delete behavior. This ensures entities handle auditing, tenancy, and deletion concerns while maintaining domain logic encapsulation within aggregate boundaries.

What's the difference between generic and custom repositories in ABP?

Generic repositories provide out-of-box CRUD operations for standard queries, while custom repositories extend them with domain-specific query logic. Use custom repositories when you need complex filtering, specialized business rules, or queries involving multiple aggregates to keep data access concerns separate from entities.

When should I create a domain service versus adding logic to an entity?

Create a domain service when business logic involves multiple entities, external domain concepts, or operations beyond a single aggregate's responsibility. Domain services keep entities focused on their own state while handling cross-aggregate orchestration, making logic reusable and testable.

How do I implement data seeding for ABP domain models?

Implement data seeding by creating seed data workflows that populate your entities with initial values using EF Core and ABP's data-seeding infrastructure. This ensures consistent baseline data across environments for testing, development, and production scenarios.

Can I use soft delete and auditing together in ABP entities?

Yes, combine soft delete using ISoftDelete with auditing through FullAuditedAggregateRoot to track creation, modification timestamps, and user information while preserving deleted records. ABP handles both concerns through base classes, enabling audit trails for compliance without data loss.

Does ABP support multi-tenancy at the entity level?

Yes, ABP supports multi-tenancy at the entity level through the IMultiTenant interface, which adds tenant isolation automatically. This ensures each tenant's data remains segregated in the database while your repositories and domain services handle tenant context transparently.