Mimicking SQL Insert Trigger with LINQ-to-SQL?

If you want it to happen just before it is saved; you can override SubmitChanges and call GetChangeSet() to get the pending changes. Look for the things you are interested in (for example delta.Inserts.OfType() and make your required changes.

The Add method only sets up a link between the two objects: it doesn't mark the added item for insertion into the database. For that, you need call InsertOnSubmit on the Table instance contained within your DataContext. The trouble, of course, is that there's no innate way to access your DataContext from the method you describe.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions