Read about delete behaviour in Entity Framework.
You can choose how an enitity behave on delete so it can affect child/dependant.
In your case you need "Cascade" delete behaviour which automatically delete children/dependants of the entity you are deleting.
Do it like this in you OnModelCreating method:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<PARENT>()
.........
.OnDelete(DeleteBehavior.Cascade);
}
Take a look here on how to use and what is about:
https://entityframeworkcore.com/saving-data-cascade-delete#:~:text=Entity%20Framework%20Core%20Cascade%20Delete&text=Cascade%20delete%20allows%20the%20deletion,delete%20behaviors%20of%20individual%20relationships.