I need delete records from few related tables:
//delete all related fields
var valuesForDelete = from v in dbc.tablea
where v.resource_id== id
var listValuesForDelete = from lv in dbc.tableb
where lv.RESOURCE_ID == id
var fieldsForDelete = from f in dbc.tablec
where f.RESOURCE_ID == id
var resourceForDelete = from r in dbc.resources
where r.ID == id
should be deleted all child records from tablea, then tableb then tablec and at the end should be deleted resource.
unfortunately order of deleting is diferent and I have error message that record can't be deleted becouse related child records are exist.
Is it possible to have control about order of deleting operations?