Hi,
I have the following code:
1 partial void OnValidate(System.Data.Linq.ChangeAction action)
2 {
3 if (action == ChangeAction.Delete)
4 {
5 MyDataContext dc = new MyDataContext();
6
7 int amount = (from l in dc.Links
8 where l.Parent == this.Id
9 select l).Count();
10 if (amount > 0)
11 throw new ValidationException("Unable to delete a parent object, delete the ...
Go to the complete details ...