Starts in:
1 DAY
12 HRS
26 MIN
52 SEC
Starts in:
1 D
12 H
26 M
52 S
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


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team 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())
        }
    }
    
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06