Ends in:
5 DAYS
17 HRS
40 MIN
41 SEC
Ends in:
5 D
17 H
40 M
41 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 26, 2024, 12:49