Linq to sql - delete some related records
问题 I´m using linq to sql and I have a lot of tables with foreign keys leading to the UserId. Is it possible to have some of these foreign tables cleaned upon deletion. For example I want the users profile (other table) to be deleted automatically with the user but not the users forum posts. Is this possible or do I have to handle this with code? 回答1: I think this link is very usefull. LINQ to SQL does not support or recognize cascade-delete operations. If you want to delete a row in a table that