I'm using built-in CRUD operations in ABP .NET Core but when it returned the data from the GetAll method, its retuned all parent rows, but return null in their list of children.
public class MainProjectAppService : AsyncCrudAppService<MainProject, MainProjectDto, int, PagedAndSortedResultRequestDto, MainProjectDto, MainProjectDto>
{
public MainProjectAppService(IRepository<MainProject, int> repositoryr) : base(repository)
{
}
}
My Dto Code
[AutoMap(typeof(MainProject))]
public class MainProjectDto:EntityDto<int>
{
:
:
:
}
I think your problem is not a mapping problem. You should override CreateFilteredQuery of AsyncCrudAppService and include your detail list properties. AsyncCrudAppService GetAll calls this protected method. You can also add your additional linq queries from this method. If you do not include detail relations they are not included resulting actual sql query :
protected override IQueryable<YourEntity> CreateFilteredQuery(PagedAndSortedResultRequestDto input)
{
return base.CreateFilteredQuery(input)
.Include(p => p.YourDetailListProperty)
.Include(p => p.YourOtherDetailListProperty)
}