diff --git a/docs/Index.md b/docs/Index.md index 370f40179b..0a8d8ea6c3 100644 --- a/docs/Index.md +++ b/docs/Index.md @@ -12,7 +12,19 @@ * Basics * Plug-In Modules * Best Practices +* Domain Driven Design + * Domain Layer + * [Entities & Aggregate Roots](Entities.md) + * Value Objects + * [Repositories](Repositories.md) + * Domain Services + * Specifications + * Domain Events + * Application Layer + * Application Services + * Data Transfer Objects + * Unit Of Work * Data Access * [Entity Framework Core Integration](Entity-Framework-Core.md) -* Presentation (User Interface) +* Presentation / User Interface * Localization \ No newline at end of file diff --git a/docs/Repositories.md b/docs/Repositories.md new file mode 100644 index 0000000000..1b89fa6443 --- /dev/null +++ b/docs/Repositories.md @@ -0,0 +1,10 @@ +## Repositories + +"*Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects*" (Martin Fowler). + +Repositories, in practice, are used to perform database operations for domain objects (see [Entities](Entities.md)). Generally, a separated repository is used for each **aggregate root** or entity. + +### Generic Repositories + +ABP can provide a default generic repository for each aggregate root or entity. You can [inject](Dependency-Injection.md) `IRepository` into your service and perform standard CRUD operations. Example usage: + diff --git a/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs b/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs index 553ca30abd..7754f16cda 100644 --- a/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs +++ b/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Domain/Person.cs @@ -1,6 +1,8 @@ using System; using System.Collections.ObjectModel; +using Volo.Abp.Application.Services; using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; using Volo.Abp.MultiTenancy; namespace Volo.Abp.TestApp.Domain