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 v8.2.0-preview Updated on March 25, 2024, 15:11