Retrieve child entities from CrudAppService in ABP

前端 未结 5 1019
忘了有多久
忘了有多久 2021-01-03 16:47

The GetAll and Get methods of the ready-made CrudAppService don\'t include child entities.

Is it possible to modify its behavi

5条回答
  •  走了就别回头了
    2021-01-03 17:19

    For whom that work with AsyncCrudAppService and you have two different lists of child:

    Below to get specific parent Object with their list of child

     protected override Task GetEntityByIdAsync(int id)
            {
                var entity = Repository.GetAllIncluding(p => p.listOfFirstChild).Include(x => x.listOfSecondChild).FirstOrDefault(p => p.Id == id);
                return base.GetEntityByIdAsync(id);
            }
    
    

提交回复
热议问题