We perform delete function on EntityName by calling the DeleteAsync on the repository EntityNameRepository.
However EntityName has a number of child tables. DeleteAsync sets the IsDeleted value to true for the EntityName however that doesn't happen for the child entities of EntityName.
How to cascade delete all entities associated with EntityName
12 Answer(s)
-
0
Hi maliming :)
Thanks for the reply. I was checking out the github link you shared.
I tried to add the override for deleteasync just like how we did for the WithDetailsAsync but that didn't work out.
Do you have any reference code which we can refer to that extends deleteasync to soft delete the subcollections ?
Thank you
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
You can see the
DeleteAsyncmethod in base class.https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs#L186 https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs#L439
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
so do we have to call deleteasync mulltiple times to delete subcollections? how do we go on and soft delete multiple subcollection. i tried x =>x.Id == id inside deleteasync but it deletes only the main record.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

