If I understood correctly your scenario, you want when a "school
" is deleted, all "teachers
" associated to this "school
" to be also deleted. If this is your scenario, you should set the IsDependent
flag to the association between these classes. IsDependent
flag should be set to association when you want to delete all of the child records of a parent record when the parent record is deleted. More information about IsDependent
association you could find in this documentation article
Cascading delete in Telerik Data Access
should be used when you have a multi-table entity, which means one class to be mapped to more than one table, then when you delete the object through the context, all table which are mapped to this class should be cleaned.
I hope that helps.
Check out the latest announcement
about Telerik Data Access vNext as a powerful framework
able to solve core development problems.