Open Closed

Questing Regarding Domain Service #6778


User avatar
0
sukhdeep.dhillon created
  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)

in my application, I have created few domain services to only create child entities with new Guid id by using GuidGenerator service in Domain manager.

is there any way, I can get rid of these domain services because they are only there to create guid for child entity

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can create child entities directly in the application service

    public class TestAppService: ....
    {
        public async Task CreateAsync()
        {
            var entity = ....;
            var childEntity = new ChildEntity(_guidGenerator.Create())
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 23, 2026, 09:57
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.