-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
Sub-entity means the class inherits the Entity or Entity<TKey>. CRUD for Sub-entities doesn't need to generate specifics but generates during the aggregate root CRUD generation.
Assume I am generating CRUD code for the "Author" entity of the "Book" aggregate.
- If the Author entity is a sub-entity collection of the aggregate root (
List<Author> Authors { get; set; }or other list-type properties):- Generate
CreateAuthorAsync,UpdateAuthorAsyncandDeleteAuthorAsyncmethod in the IBookAppService, instead of an independence IAuthorAppService. - Generate DTOs, UI, ViewModels, and ctor for sub-entities.
- Use the above APIs to implement the CRUD page and modals. Refer to the ProductAssetPeriod entity of the booking plugin for EShop.
- Skip generating as an arg in the ctor input. See CRUD: entity ctor generation improvement #175.
- Generate
- If the Author entity is NOT a sub-entity collection of the aggregate root (
Author Author { get; set; }):- Generate DTOs and ViewModels sub-entities.
Finally, I think the CRUD generation could limit to work only for aggregate roots since we generate CRUD for sub-entities during the aggregate root CRUD generation.
Metadata
Metadata
Assignees
Labels
No labels